Which google sheets function is specifically designed to convert a unix epoch timestamp to a regular datetime in the utc timezone?

which google sheets function is specifically designed to convert a unix epoch timestamp to a regular datetime in the utc timezone?

EPOCH2DATE is the specific Google Sheets function designed to convert a Unix epoch timestamp (in seconds) directly into a regular datetime formatted for the UTC timezone.

While many users traditionally rely on manual mathematical formulas involving the value 25569, Google introduced the EPOCH2DATE function to simplify this exact process without requiring complex arithmetic.


[Table of Contents]

  1. What is the EPOCH2DATE Function?
  2. How to Use It: Syntax and Examples
  3. Traditional Method vs. EPOCH2DATE
  4. Summary Table
  5. Frequently Asked Questions

[What is the EPOCH2DATE Function?]

The EPOCH2DATE function converts a Unix timestamp—which is the number of seconds that have elapsed since January 1, 1970 (the Unix Epoch)—into a readable date and time. By default, Google Sheets treats the output of this function as UTC (Coordinated Universal Time).

This is a significant improvement over older methods because it handles the transformation in a single, readable step, making your spreadsheets easier to audit and maintain.

:light_bulb: [Pro Tip:] If your timestamp is in milliseconds (13 digits) instead of seconds (10 digits), you must divide the value by 1000 inside the function: =EPOCH2DATE(A1/1000).


[How to Use It: Syntax and Examples]

The syntax for the function is straightforward:
=EPOCH2DATE(timestamp)

Practical Example:
If cell A1 contains the Unix timestamp 1715856000:

  1. Enter the formula: =EPOCH2DATE(A1)
  2. The result will display as: 5/16/2024 10:40:00 (depending on your cell formatting).

[Traditional Method vs. EPOCH2DATE]

Before this specific function was available, users had to use a mathematical conversion. Understanding the difference helps highlight why the new function is preferred.

Feature EPOCH2DATE Function Traditional Math Formula
Formula =EPOCH2DATE(value) =(value/86400) + DATE(1970,1,1)
Complexity Very Low Moderate
Readability High (Self-explanatory) Low (Requires knowing 86400 seconds/day)
Timezone Defaults to UTC Depends on Spreadsheet Settings

[Summary Table]

Key Component Details
Primary Function EPOCH2DATE
Input Required Unix Timestamp (in seconds)
Default Timezone UTC
Common Use Case Converting API data or system logs to readable dates

[Frequently Asked Questions]

1. Does EPOCH2DATE account for my local timezone?
No, the function is specifically designed to return the UTC datetime. To convert it to a local timezone, you would need to add or subtract the hour offset (e.g., + (3/24) for UTC+3).

2. What happens if my timestamp is a string?
Google Sheets usually coerces numeric strings into numbers automatically. However, if you get an error, wrap your reference in the VALUE() function: =EPOCH2DATE(VALUE(A1)).

3. Is there a function to go the other way?
Yes, you can use the DATE2EPOCH function to convert a regular date back into a Unix timestamp.


[Next Steps]

Would you like to see how to adjust the EPOCH2DATE output to match a specific local timezone offset like EST or GMT+3?