unix_timestamp_parse function
The unix_timestamp_parse function converts a Unix timestamp, in seconds, into an object
with its date and time values in Coordinated Universal Time (UTC).
unix_timestamp_parse(UNIX_TIMESTAMP)
The function requires a whole number that fits in a signed 64-bit integer.
Example
locals {
timestamp = unix_timestamp_parse(1690328596)
rfc3339 = local.timestamp.rfc3339
}
The result includes the following attributes:
| Attribute | Description |
|---|---|
year | Calendar year. |
year_day | Day of the year. |
month | Month number. |
month_name | Full month name. |
day | Day of the month. |
weekday | Day of the week, where Sunday is 0. |
weekday_name | Full weekday name. |
hour | Hour in 24-hour time. |
minute | Minute of the hour. |
second | Second of the minute. |
rfc3339 | RFC 3339 timestamp string. |
iso_year | ISO 8601 week-numbering year. |
iso_week | ISO 8601 week number. |
Related functions
rfc3339_parseconverts an RFC 3339 timestamp into date and time values.formatdateformats an RFC 3339 timestamp string.