Given an RFC3339 timestamp string, will parse and return an object representation of that date and time.
# Configuration using provider functions must include required_providers configuration.
terraform {
required_providers {
time = {
source = "hashicorp/time"
# Setting the provider version is a strongly recommended practice
# version = "..."
}
}
# Provider functions require Terraform 1.8 and later.
required_version = ">= 1.8.0"
}
output "example_output" {
value = provider::time::rfc3339_parse("2023-07-25T23:43:16Z")
}
rfc3339_parse(timestamp string) object
timestamp
(String) RFC3339 timestamp string to parseThe object
returned from rfc3339_parse
has the following attributes:
year
(Number) The year for the timestamp.year_day
(Number) The day of the year for the timestamp, in the range [1, 365] for non-leap years, and [1, 366] in leap years.day
(Number) The day of the month for the timestamp.month
(Number) The month of the year for the timestamp.month_name
(String) The name of the month for the timestamp (ex. "January").weekday
(Number) The day of the week for the timestamp.weekday_name
(String) The name of the day for the timestamp (ex. "Sunday").hour
(Number) The hour within the day for the timestamp, in the range [0, 23].minute
(Number) The minute offset within the hour for the timestamp, in the range [0, 59].second
(Number) The second offset within the minute for the timestamp, in the range [0, 59].unix
(Number) The number of seconds elapsed since January 1, 1970 UTC.iso_year
(Number) The ISO 8601 year number.iso_week
(Number) The ISO 8601 week number.