EPOCHTODATE
The EPOCHTODATE
function in Google Sheets is a useful tool for converting a Unix epoch timestamp in seconds, milliseconds, or microseconds to a datetime in UTC. With this function, you can easily work with timestamps and perform various calculations.
Function Syntax and Parameters
Syntax: EPOCHTODATE(timestamp, [unit])
Parameters:
timestamp
: The Unix epoch timestamp to convert to a datetime.unit
[Optional]: The unit of the timestamp (seconds, milliseconds, or microseconds). If not specified, it is assumed to be in seconds.
Step-by-Step Tutorial
-
Converting a timestamp to a datetime:
- Example:
=EPOCHTODATE(1599811200)
- Result:
2020-09-11
- Example:
-
Converting a timestamp with a specified unit:
- Example:
=EPOCHTODATE(1599811200000, "milliseconds")
- Result:
2020-09-11
- Example:
Use Cases and Scenarios
- Data Analysis: Convert Unix epoch timestamps to datetimes for further analysis.
- Time Series Analysis: Work with timestamps in various time units.
- API Integration: Convert timestamps received from an API to a readable format.
Related Functions
DATE
: Returns the date value in the specified format.TIME
: Returns the time value in the specified format.