Converts a Unix epoch timestamp in seconds, milliseconds, or microseconds to a datetime in UTC. Learn more
EPOCHTODATE is a function that converts a Unix timestamp (also known as Epoch time) into a human-readable date and time format. The Unix timestamp represents the number of seconds that have elapsed since January 1, 1970, at 00:00:00 UTC.
The function takes two arguments: the first argument is the Unix timestamp that you want to convert to a date and time format, and the second argument (optional) specifies the unit of the timestamp. The unit can be seconds, milliseconds, microseconds, or nanoseconds. If the unit argument is not provided, the default unit is seconds.
When you use the EPOCHTODATE function, it returns a string that represents the date and time in a readable format, such as "YYYY-MM-DD HH:MM:SS". For example, if you pass a Unix timestamp of 1616973800 to the EPOCHTODATE function, it will return "2021-03-29 05:10:00" (assuming the local time zone is UTC).