Grrrr.... this should be easier.
I'm trying to calculate the date and time separately then concatenate them at the end. Calculating the Time is giving me troubles.
Can anyone see what I'm missing?
Excel sheet with date times that LOOK like this:
5/4/2021 6:51:27 PM
When imported to Flow, they LOOK like this:
44320.7857291667
I'm trying to convert to a friendly format for performing calculations (greater than date, etc.). Can't seem to get the time right.
For each row in the Excel sheet:
1. Split the incoming decimal using:
first(
split(
items('Apply_to_each')?['dateTimeStamp'],
'.'
)
)
2. Use first part of split to calculate date: (This works)
formatDateTime(
addDays(
'1899-12-30',
int(
outputs('split_action')
)
),
'MM/dd/yyyy'
)
- Results in: 05/04/2021
3. Split incoming decimal, take last part:
last(
split(
items('Apply_to_each')?['dateTimeStamp'],
'.'
)
)
4. Use last part of split to calculate time (This does NOT work):
formatDateTime(
addToTime(
'1970-01-01T00:00:00Z',
int(
string(
div(
float(
outputs('split_action_2')
),
86400
)
)
),
'Second'
),
'HH:mm:ss tt'
)
- Results in: 19:14:08 PM