Description
The fromTimestamp
function converts a given UNIX timestamp into a readable date. A UNIX timestamp is a numeric representation of the milliseconds that have elapsed since January 1, 1970 (UTC).
Syntax
fromTimestamp(timestamp)
Arguments
Argument | Description |
---|---|
timestamp |
The UNIX timestamp in milliseconds that should be converted into a date. |
Return Types
The function returns a date in the following format: ddd MMM DD YYYY HH:MM:SS GMT±HHMM (time zone name), for example: Sun Jan 01 2023 00:59:59 GMT+0100 (Central European Standard Time)
.
Examples
Description | Formula | Result |
---|---|---|
Converting a timestamp |
fromTimestamp(1672531199000) |
Sun Jan 01 2023 00:59:59 GMT+0100 (Central European Standard Time) |
Another timestamp |
fromTimestamp(1609459200000) |
Fri Jan 01 2021 01:00:00 GMT+0100 (Central European Standard Time) |
Notes
- A UNIX timestamp is always in UTC time. Local time zones are reflected in the output.
- Ensure the input value is numeric to avoid errors.
- Note that the function works with milliseconds. If you have a timestamp in seconds, multiply it by
1000
first to convert it to milliseconds.
Comments
0 comments
Please sign in to leave a comment.