7
Views
4
Comments
how to conevrt local time zone to server time
Question
Application Type
Reactive

Hi ,

How we can Convert  local time to server time 

becuase in db we have diffrent time zone but local time zone is diffrent how i can do this? in table we have time in server format and local time is diffrent than  i need to compare both time how we can check this

Rank: #93

Hi Soni,


Due to the nature of Reactive applications, the dates are presented in the time zone of the client but behind the scenes it is the same date. When you send that date yo the server it will be automatically converted to the time zone of the server.

Nonetheless, if you want to display the date in another timezone than the one on your device, let's say you want to display it in UTC, you can use a JS function to convert it for you like it is explained in this post.


Hope it helps.


Cheers,
João

Rank: #171

Hi Soni,

You also can check some solution in forge, like this example.

Best Regards.

Rank: #18912

Hi João Marques

I have time save in db that is in server time zone while displaying time in drodown its dispaly in local time zone 

how i can compare with time diff

Rank: #171

To compare time difference, you can use the functions in the example image:

example:

DiffHours(LocalTime, UTCTime)

Regards.