MarkSFO
MarkSFO

Reputation: 15

Excel formula to convert UTC time to Pacific Time

A system I am using provides UTC time in the following format. 20190802145655UT

What Excel formula could I use to convert this to a timestamp 8-2-19 7:56:55 AM? I've done a bunch of searches, but the format the time is provided in is giving me a hard time. (PDT should have been -7 hours that day.)

Thanks for any help in advance!

Upvotes: 1

Views: 7123

Answers (3)

IvanM
IvanM

Reputation: 11

I tried the formulas provided and neither worked for me.

I used this and it seems to work... =C7-7/24
C7 is first cell with UTC to convert

I used the following format, custom mm/dd/yyyy h:mm AM/PM

UTC converted to PST time: enter image description here

Upvotes: 1

Ron Rosenfeld
Ron Rosenfeld

Reputation: 60224

=TEXT(LEFT(A1,14),"0000-00-00 00\:00\:00")-7/24

and format as "m-d-yy h:mm:ss AM/PM"

enter image description here

Upvotes: 3

Variatus
Variatus

Reputation: 14383

This formula will convert your UT string in cell A2 to a proper date/time value.

=VALUE(MID(A2,19,18))

This could be made more complicated by searching for the opening parenthesis but I believe your format is very rigid, with the parenthesis always in 18th position. Therefore it can be hard-coded.

The formula will return a number. Format the cell with a custom format like mm/dd/yyyy hh:mm:ss or any other format you prefer.

You can adjust the number as follows.

=VALUE(MID(A2,19,18))+(-7/24)

In this example 7 hours are being deducted from the given time. If you need more flexibility you can replace the -7 with a cell reference.

Upvotes: 0

Related Questions