cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (6,110)