cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
agneum
Level 8

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
PowerApps Staff CarlosFigueira
PowerApps Staff

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
PowerApps Staff CarlosFigueira
PowerApps Staff

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

agneum
Level 8

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,961)