diff --git a/content/filterx/function-reference.md b/content/filterx/function-reference.md index b01ff1cd..7880619a 100644 --- a/content/filterx/function-reference.md +++ b/content/filterx/function-reference.md @@ -536,47 +536,47 @@ ${MESSAGE} = strftime("%Y-%m-%dT%H-%M-%S %z", my-date); You can use the following format codes in the format string: -`%a`: The locale's abbreviated weekday name. -`%A`: The locale's full weekday name. -`%b`: The locale's abbreviated month name. -`%B`: The locale's full month name. -`%c`: The locale's appropriate date and time representation. -`%C`: The year divided by 100 and truncated to an integer, as a decimal number. -`%d`: The day of the month as a decimal number [01,31]. -`%D`: Equivalent to `%m / %d / %y`. -`%e`: The day of the month as a decimal number [1,31]; a single digit is preceded by a space. -`%f`: Fraction of the second (with or without a leading dot). Width specifies precision, `%6f` means microseconds, `%3f` means milliseconds, `%9f` means nanoseconds. `%f` just means microseconds. -`%F`: Equivalent to `%+4Y-%m-%d`. -`%g`: The last 2 digits of the week-based year (see below) as a decimal number [00,99]. -`%G`: The week-based year (see below) as a decimal number (for example, 1977). -`%h`: Equivalent to %b. -`%H`: The hour (24-hour clock) as a decimal number [00,23]. -`%I`: The hour (12-hour clock) as a decimal number [01,12]. -`%j`: The day of the year as a decimal number [001,366]. -`%m`: The month as a decimal number [01,12]. -`%M`: The minute as a decimal number [00,59]. -`%n`: A ``. -`%p`: The locale's equivalent of either a.m. or p.m. -`%r`: The time in a.m. and p.m. notation. -`%R`: The time in 24-hour notation ( %H : %M ). -`%S`: The second as a decimal number [00,60]. -`%t`: A ``. -`%T`: The time (`%H : %M : %S`). -`%u`: The weekday as a decimal number [1,7], with 1 representing Monday. -`%U`: The week number of the year as a decimal number [00,53]. The first Sunday of January is the first day of week 1; days in the new year before this are in week 0. -`%V`: The week number of the year (Monday as the first day of the week) as a decimal number [01,53]. If the week containing 1 January has four or more days in the new year, then it is considered week 1. Otherwise, it is the last week of the previous year, and the next week is week 1. Both January 4th and the first Thursday of January are always in week 1. -`%w`: The weekday as a decimal number [0,6], with 0 representing Sunday. -`%W`: The week number of the year as a decimal number [00,53]. The first Monday of January is the first day of week 1; days in the new year before this are in week 0. -`%x`: The locale's appropriate date representation. -`%X`: The locale's appropriate time representation. -`%y`: The last two digits of the year as a decimal number [00,99]. -`%Y`: The year as a decimal number (for example, 1997). -`%z`: The offset from UTC in the ISO 8601:2000 standard format ( +hhmm or -hhmm ), or by no characters if no timezone is determinable -`%Z`: Same as `%z` , but with the `:` separator (-hh:mm or +hh:mm) - -{{% alert title="Note" color="info" %}} -`%Z` currently doesn't respect the datetime's timezone, use `%z` instead. -{{% /alert %}} +- `%a`: The locale's abbreviated weekday name. +- `%A`: The locale's full weekday name. +- `%b`: The locale's abbreviated month name. +- `%B`: The locale's full month name. +- `%c`: The locale's appropriate date and time representation. +- `%C`: The year divided by 100 and truncated to an integer, as a decimal number. +- `%d`: The day of the month as a decimal number [01,31]. +- `%D`: Equivalent to `%m / %d / %y`. +- `%e`: The day of the month as a decimal number [1,31]; a single digit is preceded by a space. +- `%f`: Fraction of the second (with or without a leading dot). Width specifies precision, `%6f` means microseconds, `%3f` means milliseconds, `%9f` means nanoseconds. `%f` just means microseconds. +- `%F`: Equivalent to `%+4Y-%m-%d`. +- `%g`: The last 2 digits of the week-based year (see below) as a decimal number [00,99]. +- `%G`: The week-based year (see below) as a decimal number (for example, 1977). +- `%h`: Equivalent to %b. +- `%H`: The hour (24-hour clock) as a decimal number [00,23]. +- `%I`: The hour (12-hour clock) as a decimal number [01,12]. +- `%j`: The day of the year as a decimal number [001,366]. +- `%m`: The month as a decimal number [01,12]. +- `%M`: The minute as a decimal number [00,59]. +- `%n`: A ``. +- `%p`: The locale's equivalent of either a.m. or p.m. +- `%r`: The time in a.m. and p.m. notation. +- `%R`: The time in 24-hour notation ( %H : %M ). +- `%S`: The second as a decimal number [00,60]. +- `%t`: A ``. +- `%T`: The time (`%H : %M : %S`). +- `%u`: The weekday as a decimal number [1,7], with 1 representing Monday. +- `%U`: The week number of the year as a decimal number [00,53]. The first Sunday of January is the first day of week 1; days in the new year before this are in week 0. +- `%V`: The week number of the year (Monday as the first day of the week) as a decimal number [01,53]. If the week containing 1 January has four or more days in the new year, then it is considered week 1. Otherwise, it is the last week of the previous year, and the next week is week 1. Both January 4th and the first Thursday of January are always in week 1. +- `%w`: The weekday as a decimal number [0,6], with 0 representing Sunday. +- `%W`: The week number of the year as a decimal number [00,53]. The first Monday of January is the first day of week 1; days in the new year before this are in week 0. +- `%x`: The locale's appropriate date representation. +- `%X`: The locale's appropriate time representation. +- `%y`: The last two digits of the year as a decimal number [00,99]. +- `%Y`: The year as a decimal number (for example, 1997). +- `%z`: The offset from UTC in the ISO 8601:2000 standard format ( +hhmm or -hhmm ), or by no characters if no timezone is determinable +- `%Z`: Same as `%z` , but with the `:` separator (-hh:mm or +hh:mm) + + {{% alert title="Note" color="info" %}} + `%Z` currently doesn't respect the datetime's timezone, use `%z` instead. + {{% /alert %}} ## strptime diff --git a/content/headless/chunk/date-string-format.md b/content/headless/chunk/date-string-format.md index 02a269fe..e3ce5101 100644 --- a/content/headless/chunk/date-string-format.md +++ b/content/headless/chunk/date-string-format.md @@ -1,44 +1,46 @@ -`%a`: The day of week, using the locale's weekday names. Either the abbreviated or full name may be specified. -`%A`: Same as %`a`. -`%b`: The month, using the locale's month names. Either the abbreviated or full name may be specified. -`%B`: The same as `%b`. -`%c`: The date and time, using the locale's date and time format. -`%C`: The century number [0,99]. Leading zeros are permitted but not required. This conversion should be used in conjunction with the %y conversion. -`%d`: The day of month [1,31]. Leading zeros are permitted but not required. -`%D`: The date as `%m/%d/%y`. -`%e`: The same as `%d`. -`%F`: The date as `%Y-%m-%d` (the ISO 8601 date format). -`%g`: The year corresponding to the ISO week number, without the century. (A NetBSD extension.) -`%G`: The year corresponding to the ISO week number, with the century. (A NetBSD extension.) -`%h`: The same as `%b`. -`%H`: The hour (24-hour clock) [0,23]. Leading zeros are permitted but not required. -`%I`: The hour (12-hour clock) [1,12]. Leading zeros are permitted but not required. -`%j`: The day number of the year [1,366]. Leading zeros are permitted but not required. -`%k`: The same as `%H`. -`%l`: The same as `%I`. -`%m`: The month number [1,12]. Leading zeros are permitted but not required. -`%M`: The minute [0,59]. Leading zeros are permitted but not required. -`%n`: Any white-space, including none. -`%p`: The locale's equivalent of a.m. or p.m. -`%r`: The time (12-hour clock) with `%p`, using the locale's time format. -`%R`: The time as `%H:%M`. -`%S`: The seconds [0,60]. Leading zeros are permitted but not required. -`%s`: The number of seconds since the Epoch, UTC (see mktime(3)). (A NetBSD extension.) -`%f`: Fraction of the second (with or without a leading dot). -`%t`: Any white-space, including none. -`%T`: The time as `%H:%M:%S`. -`%u`: The day of the week as a decimal number, where Monday = 1. (A NetBSD extension.) -`%U`: The week number of the year (Sunday as the first day of the week) as a decimal number [0,53]. Leading zeros are permitted but not required. All days in a year preceding the first Sunday are considered to be in week 0. -`%V`: The ISO 8601:1988 week number as a decimal number. If the week (starting on Monday) that contains January 1 has more than three days in the new year, then it is considered the first week of the year. If it has fewer than four days in the new year, then it is considered the last week of the previous year. Weeks are numbered from 1 to 53. (A NetBSD extension.) -`%w`: The weekday as a decimal number [0,6], with 0 representing Sunday. Leading zeros are permitted but not required. -`%W`: The week number of the year (Monday as the first day of the week) as a decimal number [0,53]. Leading zeros are permitted but not required. All days in a year preceding the first Monday are considered to be in week 0. -`%x`: The date, using the locale's date format. -`%X`: The time, using the locale's time format. -`%y`: The year within the 20th century [69,99] or the 21st century [0,68]. Leading zeros are permitted but not required. If specified in conjunction with `%C`, specifies the year [0,99] within that century. -`%Y`: The year, including the century (i.e., 1996). -`%Z`: Timezone in ascii format (for example, PST), or in format -/+0000, accepts `:` in the middle of timezones (ISO 8601) -`%z`: Timezone in ascii format (for example, PST), or in format -/+0000, accepts `:` in the middle of timezones (ISO 8601) (Required element) -`%%`: matches a literal `%`. No argument is converted. +--- +--- +- `%a`: The day of week, using the locale's weekday names. Either the abbreviated or full name may be specified. +- `%A`: Same as %`a`. +- `%b`: The month, using the locale's month names. Either the abbreviated or full name may be specified. +- `%B`: The same as `%b`. +- `%c`: The date and time, using the locale's date and time format. +- `%C`: The century number [0,99]. Leading zeros are permitted but not required. This conversion should be used in conjunction with the %y conversion. +- `%d`: The day of month [1,31]. Leading zeros are permitted but not required. +- `%D`: The date as `%m/%d/%y`. +- `%e`: The same as `%d`. +- `%F`: The date as `%Y-%m-%d` (the ISO 8601 date format). +- `%g`: The year corresponding to the ISO week number, without the century. (A NetBSD extension.) +- `%G`: The year corresponding to the ISO week number, with the century. (A NetBSD extension.) +- `%h`: The same as `%b`. +- `%H`: The hour (24-hour clock) [0,23]. Leading zeros are permitted but not required. +- `%I`: The hour (12-hour clock) [1,12]. Leading zeros are permitted but not required. +- `%j`: The day number of the year [1,366]. Leading zeros are permitted but not required. +- `%k`: The same as `%H`. +- `%l`: The same as `%I`. +- `%m`: The month number [1,12]. Leading zeros are permitted but not required. +- `%M`: The minute [0,59]. Leading zeros are permitted but not required. +- `%n`: Any white-space, including none. +- `%p`: The locale's equivalent of a.m. or p.m. +- `%r`: The time (12-hour clock) with `%p`, using the locale's time format. +- `%R`: The time as `%H:%M`. +- `%S`: The seconds [0,60]. Leading zeros are permitted but not required. +- `%s`: The number of seconds since the Epoch, UTC (see mktime(3)). (A NetBSD extension.) +- `%f`: Fraction of the second (with or without a leading dot). +- `%t`: Any white-space, including none. +- `%T`: The time as `%H:%M:%S`. +- `%u`: The day of the week as a decimal number, where Monday = 1. (A NetBSD extension.) +- `%U`: The week number of the year (Sunday as the first day of the week) as a decimal number [0,53]. Leading zeros are permitted but not required. All days in a year preceding the first Sunday are considered to be in week 0. +- `%V`: The ISO 8601:1988 week number as a decimal number. If the week (starting on Monday) that contains January 1 has more than three days in the new year, then it is considered the first week of the year. If it has fewer than four days in the new year, then it is considered the last week of the previous year. Weeks are numbered from 1 to 53. (A NetBSD extension.) +- `%w`: The weekday as a decimal number [0,6], with 0 representing Sunday. Leading zeros are permitted but not required. +- `%W`: The week number of the year (Monday as the first day of the week) as a decimal number [0,53]. Leading zeros are permitted but not required. All days in a year preceding the first Monday are considered to be in week 0. +- `%x`: The date, using the locale's date format. +- `%X`: The time, using the locale's time format. +- `%y`: The year within the 20th century [69,99] or the 21st century [0,68]. Leading zeros are permitted but not required. If specified in conjunction with `%C`, specifies the year [0,99] within that century. +- `%Y`: The year, including the century (i.e., 1996). +- `%Z`: Timezone in ascii format (for example, PST), or in format -/+0000, accepts `:` in the middle of timezones (ISO 8601) +- `%z`: Timezone in ascii format (for example, PST), or in format -/+0000, accepts `:` in the middle of timezones (ISO 8601) (Required element) +- `%%`: matches a literal `%`. No argument is converted. {{% alert title="Warning" color="warning" %}}