I am using two functions to extract both the date & time out of a string:
Raw String in DATA!A2: 2022-03-06T04:52:33.813Z
=LEFT(DATA!$A$2,FIND("T",DATA!$A$2)-1)
to reformat a string into a date:
Result: 2022-03-06
In another cell I am extracting the time and converting it to USA CT time:
=MID(DATA!$A$2,12,5)-"6:00"
Result: 10:52 PM
The Issue:
I have successfully subtracted 6 hours to convert this time to CT, but now whenever the time is on or after 6 PM CT, the date (2022-03-06) prematurely advances to the next day. In the example above, because 10:52 PM is after 6 PM, the date should be showing 2022-03-05.
Are there any ways to check if the time is after 6 PM, and if that is TRUE, to correct the date by -1 days?