cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
agneum
Advocate IV
Advocate IV

Offset gallery by one hour

DateTimeValue("2019-02-27T10:00:00.000Z") gives me :

2/27/2019 11:00 AM

I suspect this has to do with my current timezone (GMT+1).
Why would the function act this way though? If I pass a string to DateTimeValue I expect it to assume I'm passing it in with my own local timezone..

Seems like a bug to me

 

1 ACCEPTED SOLUTION

Accepted Solutions
CarlosFigueira
Power Apps
Power Apps

If the string you pass to the DateTimeValue function does not have a time zone specifier, then it will be parsed in your own time zone. However, the specifier 'Z' that you have at the end of the string indicates that the value is from UTC, per the ISO 8601 format. If you remove it:

DateTimeValue("2019-02-27T10:00:00.000")

Then it will interpret the value as local (and you'll see "2/27/2019 10:00 AM" as you expect).

Hope this helps!

View solution in original post

2 REPLIES 2
CarlosFigueira
Power Apps
Power Apps

If the string you pass to the DateTimeValue function does not have a time zone specifier, then it will be parsed in your own time zone. However, the specifier 'Z' that you have at the end of the string indicates that the value is from UTC, per the ISO 8601 format. If you remove it:

DateTimeValue("2019-02-27T10:00:00.000")

Then it will interpret the value as local (and you'll see "2/27/2019 10:00 AM" as you expect).

Hope this helps!

View solution in original post

Thank you, I removed the Z-value from my datetime string and it worked just fine!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (25,342)