Time is changing when the column data type is date

Hello, 

I have a grid like this, In here the value of 'Action Date' is changing when we change the local time zone to -6. Currently I'm in +5:30 and this is giving some issues to us.

The values shouldn't be changed with the timezone change in our local system. When I change the datatype to string in grid then the date values are showing correctly.

Can I disable this conversion with keeping the date time values as data type 'Date'?

Image_2536_1697791607154


3 Replies

KS Kavishka Subashana October 30, 2023 02:25 PM UTC

Hello,

Please I need a solution for this asap because we have clients which cannot proceed without this fix for the functionality in the application.

Thank you



KS Kavishka Subashana November 8, 2023 07:45 AM UTC

Hello,

This is high priority fix for us. We are glad if we can get a solution asap.

Thank you



PS Pon Selva Jeganathan Syncfusion Team November 10, 2023 02:43 PM UTC

Hi Kavishka Subashana,


Query: Time is changing when the column data type is date


The mentioned issue may occur due to TimeZone offset differences, we can resolve this time zone issue with ServerTimezoneOffset, this property is used to set the time-zone offset from UTC, in hours. we suggest you perform the time zone calculation as explained in our below UG documentation,

https://help.syncfusion.com/js/datamanager/servertimezoneoffset

Refer to the below code example,


 

<script>

    var serverTimeZoneDiff = +1.0   //  server time zone  (in hours)

    var clientSideTimeZoneDiff = new Date().getTimezoneOffset() / 60;

    // get client time zone difference and convert it to hours;

    ej.serverTimezoneOffset = serverTimeZoneDiff + clientSideTimeZoneDiff;

</script>


Kindly get back to us for further assistance.


Regards,
Pon selva


If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Loader.
Up arrow icon