Home > Blockchain >  What datetime format is this 2022-04-05T12:39:34.579775Z and how to convert to US date time format?
What datetime format is this 2022-04-05T12:39:34.579775Z and how to convert to US date time format?

Time:10-04

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?

CodePudding user response:

enter image description here

try:

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

enter image description here

enter image description here

see: enter image description here

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

see map: 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!

CodePudding user response:

You can try

date('Y-m-d h:i:s', strtotime($yourDate));
  • Related