I have timestamps stored in time since epoch (ms) and I would like to query and display results using a date formatted like 'yyyy-mm-dd'.
You can convert timestamp to date with cast(col as date) or date(col) .
Presto provides many date time functions to help with conversion. In case of a Unix Epoch Time, the from_unixtime function can be used to convert the Epoch time. This function returns a timestamp. Returns the UNIX timestamp unixtime as a timestamp.
cast(from_unixtime(unixtime) as date)
See https://prestodb.io/docs/current/functions/datetime.html for more datetime functions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With