cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X

Date Time Picker automatically converts Local Time to GMT 00

nikkolasep
12-Amethyst

Date Time Picker automatically converts Local Time to GMT 00

Hi all,

 

I'm facing an issue with Date Time Picker widget that auto converts the picked time (e.g. 03-08-2023 00:00:00 GMT+2) to the GMT 00 Time (e.g. 02-08-2023 22:00:00 GMT 00). And because I'm in Germany this is can be solved by statically adding +2 to the selected datetime, but it has to also check the so called Daylight Save Time that sometimes can affect the time shifting between GMT+2 and GMT+1. 

 

Applying  getTimezoneOffset() won't work because it's already converted directly to GMT 00 (UTC) which means applying getTimezoneOffset() will always return 0.

 

Is there a way to avoid the timezone conversion between the Date Time Picker widget so that if my customers from all over the world select 03.08.2023 00:00:00 on the Date Time Picker widget it will be also understood and processed further as 03.08.2023 00:00:00 GMT 00 no matter where they are, and regardless the Daylight Saving Time that may vary. 

 

 

 

ACCEPTED SOLUTION

Accepted Solutions
jensc
17-Peridot
(To:nikkolasep)

Hello @nikkolasep 

 

I'll post this here for you do go over if you haven't already. 

It is an support article giving some examples on how to "not" convert dates.

 

But not sure if it covers your exact use case

 

Regards,

Jens

View solution in original post

2 REPLIES 2

Screenshot 2023-08-03 105003.png

Screenshot 2023-08-03 104924.png

Screenshot 2023-08-03 104839.png

jensc
17-Peridot
(To:nikkolasep)

Hello @nikkolasep 

 

I'll post this here for you do go over if you haven't already. 

It is an support article giving some examples on how to "not" convert dates.

 

But not sure if it covers your exact use case

 

Regards,

Jens

Announcements


Top Tags