Announcements
Hi,
I saw many people having problem with storing date time in SQL Server DB (on Premise). I am having a field "UpdatedOn" with datatype varchar(20). I follow the method mentioned in this link below but it does not solve my problem.
https://powerapps.microsoft.com/en-us/blog/working-with-datetime-values-in-sql/
I am setting "Text(Now(), "[$-en-GB]yyyy-mm-dd hh:mm:ss")" in the update parameter on the UI for "UpdatedOn". On the screen when I printed the Now() value is show "23/04/2020 14:43" but in the SQL DB it is showing "2020-04-22 23:43:06". My data type is varchar so why still stored the datetime in different time zone? Any advise?
I had this exact problem. PowerApps operates on UTC time. You would think Now() is your time but it is UTC time. This problem is easily fixed. When you create table rather then use datetime data type use datetimeoffset. Don't save as string.
[ModifiedDate] [datetimeoffset] NULL
When you save Now() I think the connector sees the offset and adds in your timezone to the UTC time. This takes in DST.
Hi, I also tried set datetimeoffset(7) but do I need to save the current date time as "DateAdd(Now(), -TimeZoneOffset(Now()), Minutes)" or just "Now()"?
After I changed the data type to "datetimeoffset", and save the updatedOn file as "Now()", the display is ok now. Maybe I need to refresh the table since I have alter it.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Jump in, show your community spirit, and win prizes!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Valantis 392
WarrenBelz 364 Most Valuable Professional
Kalathiya 271 Super User 2026 Season 1