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
Highlighted
Power Apps
Power Apps

Re: Offset gallery by one hour

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
Highlighted
Power Apps
Power Apps

Re: Offset gallery by one hour

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

Highlighted
Advocate IV
Advocate IV

Re: Offset gallery by one hour

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

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,067)