We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Datepicker and timezone gmt +1 and utc time

Hi,

when i pick a date with datepicker, in the frontend it is shown with my local time  gmt+1.

As soon as i pass it to my backend it is somehow converted and e.g. "01.01.2023" will be converted to "31.12.2022 23.00".

Is there an option for datepicker to save it directly in utc-time?

My workaround so far is 

this.utcValue.setHours(0, -this.utcValue.getTimezoneOffset(), 00);

See also my Stackblitz example: https://stackblitz.com/edit/angular-ivy-6yqhi7?file=src/app/app.component.ts

Regards

Matthias


1 Reply 1 reply marked as answer

SP Sureshkumar P Syncfusion Team December 8, 2022 10:55 AM UTC

Hi Matthias,

The datepicker component cannot have the option to get the value as UTC-time. So, you can get the UTC value as mentioned in your workaround solution.

Regards,

Sureshkumar P


Marked as answer
Loader.
Up arrow icon