How to add hours in UTCNOW() and return the result as Date format

I want to know the date of another Timezone based on the given time.

Example:

User is in Timezone UTC+4 and local time is 11:40pm of 19-April-2024. What I want to achieve is to return the date and time stamp of UTC+8 timezone regardless of where the user is based.

The date I want to return is the date of UTC+8 timezone. In the above example, i should get the date 20-April-2024 03:40am as this is the date and time in the UTC+8 local time.

Thanks in advance!

 

 

Solved Solved
0 6 88
1 ACCEPTED SOLUTION

UTCNOW()+"008:00:00" should do the job with the initial value. Though you need to remember that the UTC() is actually coming from the user's device. If the app user changes his/her time in the device for example one hour before the real time, it affects the UTCNOW() as well.

View solution in original post

6 REPLIES 6

UTCNOW()+"008:00:00" should do the job with the initial value. Though you need to remember that the UTC() is actually coming from the user's device. If the app user changes his/her time in the device for example one hour before the real time, it affects the UTCNOW() as well.

One other question, is TODAY() function works the same as UTCNOW()?

I set my laptop time manually to 11:00pm 19-Apr-2024 (i'm on UCT+4) and when I apply UTCNOW()+"008:00:00" it picks up correctly which is 20-Apr-2024. However, the TODAY() value shows the same as 20-Apr-2024 in my form. Any explanation to this? thanks again!

Did you remember to refresh the browser after you changed the date and time?

Ahhhh yes! my bad! yes its showing correctly now after refreshing the page.

Good to hear!

Thanks @AleksiAlkio ! It works and exactly the one im looking for!

Top Labels in this Space