May 07 2021 02:13 AM
I have a dataset with the date/time represented in UTC as "d hh:mm:ss". For example "12 04:14:15". How do I convert this to a PDT format?
The problem I am having is because the data does not have month or year, if I split the date and time into separate columns and subtract 7 hours from the time column, this does not capture the potential change in date.
Any suggestions greatly appreciated!
May 07 2021 05:49 AM
As variant
=LET(PDT, -7,
date, DATE(YEAR(TODAY()), MONTH(TODAY()), LEFT(A1,2)),
time, TIMEVALUE(RIGHT(A1,8)),
timePDT, time+PDT/24,
newDay, DAY(date) - (timePDT<0),
newTime, timePDT+(timePDT<0)*24,
newDay & " " & TEXT(newTime,"hh:mm:ss"))
but that's for current year and month