Excel - How to convert UTC date time

Given a UTC dateTime e.g. : 2017-08-22T14:26:30.000+1000

=(DATEVALUE(MID(A1,1,10)) +TIMEVALUE( MID(A1,12,12)))+TIME(MID(A1,25,4)/100,0,0)

There are two things in the date/time that are giving issue. The first is the T that denotes the start of time. Excel uses a space. The second is the Everything to the right of the +.

If we get rid of those then excel will see it as a Date/Time. So use this to remove the unwanted information:

=--SUBSTITUTE(LEFT(G2,FIND("+",G2)-1),"T"," ")

enter image description here

EDIT

As was pointed out by @ForwardEd this only brings in the UTC time.

Upon further thinking since this is computer generated the format will remain the same. The following formula also considers the time zone:

=(SUBSTITUTE(LEFT(A1,27),"T"," "))+(MID(A1,28,3)/24)

![enter image description here

Then format it like you want:

enter image description here

And you get:

enter image description here


Tags:

Excel