Hi,
My current system date and time is 5/25/2023 9:03 PM and also, I am passing now() to one of the pv variables (Image#1).
Image#1
But, when I try to see the db saved value, it was showing as "5/26/2023 01:03:40".
Can someone advise me, where it was going wrong.
Thanks in advance.
Discussion posts and replies are publicly visible
Date and times stored in the db are in UTC. now() is displayed in your local timezone.
Thanks for replying for my post.I have to keep values in EST. Is there any way, I can keep both values same.
Not sure if I'm understanding correctly. You want your database dates to be stored in EST?
Storing dates in UTC and then displaying them in the user context timezone is the standard way of doing things (not just in Appian but in most systems).
Right now, current date and time is "5/25/2023 9:03 PM"
If I want to keep the same value everywhere, do I need to convert before saving to db or do I need to convert while displaying.
Any further advises.
You don't need to do anything. It'll get stored in the db as 2023-05-26 01:03 UTC.
It'll display to the user in whatever timezone they have set in their profile.
If you need to do it at the db level, you can use the following (assuming your are using MariaDB): https://mariadb.com/kb/en/convert_tz/#:~:text=CONVERT_TZ()%20converts%20a%20datetime,be%20loaded%20(see%20mysql_tzinfo_to_sql).
I am using SQL Server DB.
learn.microsoft.com/.../at-time-zone-transact-sql