Reputation: 11
I'm working with data flow in azure data factory and i tried to convert an epoch formatted timestamp to date.
the value of the timestamp is '1574067907751' and i tried expressions : toDate(toTimestamp(1574067907751*1000l)) or toDate(toTimestamp(toInteger('1574067907751')*1000l,'yyyy-MM-dd HH:mm:ss'))
there is any other way to do that ?
Upvotes: 1
Views: 4665
Reputation: 512
Just in case someone is wondering:
If the timestamp comes in milliseconds, one need to cast the timestamp as long.
toTimestamp(toLong(time_milliseconds))
Upvotes: 1
Reputation: 3838
"To convert milliseconds from epoch to a date or timestamp, use toTimestamp(). If time is coming in seconds, multiply by 1,000.
toTimestamp(1574127407*1000l)
The trailing "l" at the end of the previous expression signifies conversion to a long type as inline syntax."
Upvotes: 3