From 6b48bbb9d20159300c78d115ee8590492b3eebc8 Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Sun, 8 Jun 2025 08:40:32 +0200 Subject: [PATCH 1/5] Define timeZone=local as the default time zone --- spec/functions/datetime.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/spec/functions/datetime.md b/spec/functions/datetime.md index 9fb2917055..40706b8c15 100644 --- a/spec/functions/datetime.md +++ b/spec/functions/datetime.md @@ -282,11 +282,14 @@ the functions `:datetime`, `:date`, and `:time`. - `local` - `UTC` -> [!NOTE] -> The value `local` permits a _message_ to convert a date/time value -> into a [floating](https://www.w3.org/TR/timezone/#floating) time value -> (sometimes called a _plain_ or _local_ time value) by removing -> the association with a specific time zone. +The value `local` corresponds to the default time zone. + +If the _operand_ value does not include a time zone, +it is presumed to use the default time zone. +If the _operand_ value does include a time zone and the `timeZone` _option_ is set, +an implementation SHOULD convert the value to the time zone indicated by the _option_. +If such conversion is not supported, an implementation MAY alternatively +emit a _Bad Option_ error and use a _fallback value_ as the _resolved value_ of the _expression_. The following _option_ is REQUIRED to be available on the functions `:datetime` and `:time`: From ab811ddf2cebdf7714013ce9250da290045e65d2 Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Mon, 14 Jul 2025 16:12:31 +0300 Subject: [PATCH 2/5] Replace timeZone=local with timeZone=input --- spec/functions/datetime.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spec/functions/datetime.md b/spec/functions/datetime.md index 40706b8c15..7610813f0f 100644 --- a/spec/functions/datetime.md +++ b/spec/functions/datetime.md @@ -279,13 +279,15 @@ the functions `:datetime`, `:date`, and `:time`. (see [TZDB](https://www.iana.org/time-zones) and [LDML](https://www.unicode.org/reports/tr35/tr35-dates.html#Time_Zone_Names) for information on identifiers) - - `local` + - `input` - `UTC` -The value `local` corresponds to the default time zone. +The value `input` corresponds to the time zone of the _operand_. +If it is used and _operand_ value does not include a time zone, +a _Bad Operand_ error is emitted and the default time zone is used to format the _expression_. If the _operand_ value does not include a time zone, -it is presumed to use the default time zone. +it is presumed to use the default time zone provided by the _formatting context_. If the _operand_ value does include a time zone and the `timeZone` _option_ is set, an implementation SHOULD convert the value to the time zone indicated by the _option_. If such conversion is not supported, an implementation MAY alternatively From d4c52dd24b72a9abd0491357eec5fa161705260a Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Mon, 14 Jul 2025 16:15:57 +0300 Subject: [PATCH 3/5] Use "resolved value of the operand" --- spec/functions/datetime.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/functions/datetime.md b/spec/functions/datetime.md index 7610813f0f..02ec779408 100644 --- a/spec/functions/datetime.md +++ b/spec/functions/datetime.md @@ -283,12 +283,12 @@ the functions `:datetime`, `:date`, and `:time`. - `UTC` The value `input` corresponds to the time zone of the _operand_. -If it is used and _operand_ value does not include a time zone, +If it is used and the _resolved value_ of the _operand_ does not include a time zone, a _Bad Operand_ error is emitted and the default time zone is used to format the _expression_. -If the _operand_ value does not include a time zone, +If the _resolved value_ of the _operand_ does not include a time zone, it is presumed to use the default time zone provided by the _formatting context_. -If the _operand_ value does include a time zone and the `timeZone` _option_ is set, +If the _resolved value_ of the _operand_ does include a time zone and the `timeZone` _option_ is set, an implementation SHOULD convert the value to the time zone indicated by the _option_. If such conversion is not supported, an implementation MAY alternatively emit a _Bad Option_ error and use a _fallback value_ as the _resolved value_ of the _expression_. From c53815a41325c56a1598f475314b99f01ae999f2 Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Mon, 14 Jul 2025 16:45:25 +0300 Subject: [PATCH 4/5] More text edits --- spec/functions/datetime.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/functions/datetime.md b/spec/functions/datetime.md index 02ec779408..b38eccee43 100644 --- a/spec/functions/datetime.md +++ b/spec/functions/datetime.md @@ -282,14 +282,16 @@ the functions `:datetime`, `:date`, and `:time`. - `input` - `UTC` +The default value for `timeZone` is the default time zone provided by the _formatting context_. + The value `input` corresponds to the time zone of the _operand_. If it is used and the _resolved value_ of the _operand_ does not include a time zone, a _Bad Operand_ error is emitted and the default time zone is used to format the _expression_. -If the _resolved value_ of the _operand_ does not include a time zone, -it is presumed to use the default time zone provided by the _formatting context_. -If the _resolved value_ of the _operand_ does include a time zone and the `timeZone` _option_ is set, -an implementation SHOULD convert the value to the time zone indicated by the _option_. +If the _resolved value_ of the _operand_ includes a time zone, +and the _resolved value_ of the `timeZone` _option_ is different from that, +an implementation SHOULD convert the _resolved value_ of the _operand_ +to the time zone indicated by the _resolved value_ of the `timeZone` _option_. If such conversion is not supported, an implementation MAY alternatively emit a _Bad Option_ error and use a _fallback value_ as the _resolved value_ of the _expression_. From efc5d1369f9c727f623016b9ea34561577ef806b Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Mon, 21 Jul 2025 19:55:15 +0300 Subject: [PATCH 5/5] Apply suggestions from code review --- spec/functions/datetime.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/functions/datetime.md b/spec/functions/datetime.md index b38eccee43..1bdbe02d18 100644 --- a/spec/functions/datetime.md +++ b/spec/functions/datetime.md @@ -285,10 +285,10 @@ the functions `:datetime`, `:date`, and `:time`. The default value for `timeZone` is the default time zone provided by the _formatting context_. The value `input` corresponds to the time zone of the _operand_. -If it is used and the _resolved value_ of the _operand_ does not include a time zone, +If it is used and the _resolved value_ of the _operand_ does not include a time zone or offset, a _Bad Operand_ error is emitted and the default time zone is used to format the _expression_. -If the _resolved value_ of the _operand_ includes a time zone, +If the _resolved value_ of the _operand_ includes a time zone or offset, and the _resolved value_ of the `timeZone` _option_ is different from that, an implementation SHOULD convert the _resolved value_ of the _operand_ to the time zone indicated by the _resolved value_ of the `timeZone` _option_.