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
Solved! Go to Solution.
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!
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!
Thank you, I removed the Z-value from my datetime string and it worked just fine!