aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2024-05-24 19:16:24 +0200
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2024-05-24 19:16:24 +0200
commite1c4b9b06a3beea4ce0e76f937f58cb6c121c5d8 (patch)
tree64bde94ee4b9cfad568dba35d01f24f06bedd3fc
parentff34970d7985948dc7145c58ceaf494233ee2c35 (diff)
Allow lowercase z TZ indicator.
-rw-r--r--core/time/rfc3339.odin2
-rw-r--r--tests/core/time/test_core_time.odin2
2 files changed, 3 insertions, 1 deletions
diff --git a/core/time/rfc3339.odin b/core/time/rfc3339.odin
index a4d03789d..0a2d431b7 100644
--- a/core/time/rfc3339.odin
+++ b/core/time/rfc3339.odin
@@ -87,7 +87,7 @@ _rfc3339_to_components :: proc(rfc_datetime: string) -> (res: dt.DateTime, utc_o
// Scan UTC offset
switch rfc_datetime[count] {
- case 'Z':
+ case 'Z', 'z':
utc_offset = 0
count += 1
case '+', '-':
diff --git a/tests/core/time/test_core_time.odin b/tests/core/time/test_core_time.odin
index 7161cf349..1f936e4a7 100644
--- a/tests/core/time/test_core_time.odin
+++ b/tests/core/time/test_core_time.odin
@@ -94,6 +94,8 @@ rfc3339_tests :: []RFC3339_Test{
{"1985-04-12T23:20:50.52Z", {482196050520000000}, true, 0, 23, false},
{"1985-04-12t23:20:50.52Z", {482196050520000000}, true, 0, 23, false},
{"1985-04-12 23:20:50.52Z", {482196050520000000}, true, 0, 23, false},
+ // Same, but lowercase z
+ {"1985-04-12 23:20:50.52z", {482196050520000000}, true, 0, 23, false},
// This represents 39 minutes and 57 seconds after the 16th hour of December 19th, 1996 with an offset of -08:00 from UTC (Pacific Standard Time).
// Note that this is equivalent to 1996-12-20T00:39:57Z in UTC.