What datetime format is this 2022-04-05T12:39:34.579775Z and how to convert to US date time format?
Asked Answered
A

2

1

What datetime format is this 2022-04-05T12:39:34.579775Z and how to convert to US date time format but in GMT timezone with a formula in Google Sheets when it appears in A1 and I want to return correct format in b1?

Articulate answered 3/10, 2022 at 20:34 Comment(2)
That's the international ISO format.Walloping
answer updated..Illiberal
I
3

enter image description here

try:

=SUM(SPLIT(A1, "TZ"))

enter image description here

enter image description here

see: locale differences in google sheets (documentation missing pages)

and: https://www.cl.cam.ac.uk/~mgk25/iso-time.html

and: https://en.wikipedia.org/wiki/ISO_8601#Times



update:

as mentioned Z stands for UTC

UTC ≈ GMT see: https://24timezones.com/gmt-vs-utc

The United States has 6 timezones:

enter image description here

so for example, if you reside in Pacific Time Zone you are in UTC-7

see map: https://www.timeanddate.com/time/map/

therefore your:

2022-04-05T12:39:34.579775Z

is actually equal to:

4/5/2022 5:39:34.579775

and the formula is:

=SUM(SPLIT(A1, "TZ", "-7:00"))

enter image description here

and with milliseconds:

=TEXT(SUM(SPLIT(A1, "TZ"), "-7:00"), "m/d/e h:mm:ss.000")

enter image description here

or with extra precision:

 =TEXT(SUM(SPLIT(A1, "TZ"), "-7:00"), "m/d/e h:mm:ss")&REGEXEXTRACT(A1, "(\.\d+)")

enter image description here

and don't forget to account for the Daylight Saving system!

Illiberal answered 3/10, 2022 at 20:58 Comment(0)
C
-1

You can try

date('Y-m-d h:i:s', strtotime($yourDate));
Champagne answered 3/10, 2022 at 20:38 Comment(1)
Thanks Annisa, I'm not quite sure how to make this work thoughArticulate

© 2022 - 2024 — McMap. All rights reserved.