Date parsing not fully RFC 3339 compatible

This issue has been created since 2019-07-01.

Using the following input:

date = 2019-10-10t11:12:13z

I get the error:
Error decoding TOML: Near line 1 (last key parsed ''): expected a top-level item to end with a newline, comment, or EOF, but got 't' instead

The expected output is something like:

{
   "date" : {
      "type" : "datetime",
      "value" : "2019-10-10T11:12:13Z"
   }
}

According to RFC 3339 and the toml ABNF, the "T" and "Z" part of a date/time value are case insensitive and can therefore be lower case characters.

mmakaay wrote this answer on 2019-07-01

Funny, the github syntax highlighter does approve of the "t", but not the "z", but they both are valid for date/time definitions.

arp242 wrote this answer on 2021-06-08

It looks like this is a limitation of the Go time package, which looks just at Z (and T).

RFC 3339 says:

  NOTE: Per [ABNF] and ISO8601, the "T" and "Z" characters in this
  syntax may alternatively be lower case "t" or "z" respectively.

  This date/time format may be used in some environments or contexts
  that distinguish between the upper- and lower-case letters 'A'-'Z'
  and 'a'-'z' (e.g. XML).  Specifications that use this format in
  such environments MAY further limit the date/time syntax so that
  the letters 'T' and 'Z' used in the date/time syntax must always
  be upper case.  Applications that generate this format SHOULD use
  upper case letters.

So it doesn't strictly disallow limiting to just an upper-case "Z" or "T" and implementations MAY limit this.

I'm not super-pedantic about allowing a t or z, but working around the Go time package parsing is probably a bit too much; I found this open issue for it, so ideally that should really be fixed first.

More Details About Repo
Owner Name BurntSushi
Repo Name toml
Full Name BurntSushi/toml
Language Go
Created Date 2013-02-26
Updated Date 2023-03-20
Star Count 4154
Watcher Count 84
Fork Count 518
Issue Count 15

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
numpy 1.24.1 incompatible with numba 6 2023-01-09 2023-03-01
Null for types other than pointers 3 2022-03-27 2023-03-22
Find a better way to identify valid `pg_sys::Oid`s 2 2023-01-11 2023-02-25
Hi everyone, i want to ask something related to '@veramo/remote-server' this lib. 2 2022-05-22 2022-12-27
Document what to do with copy-pasted code 3 2021-01-25 2023-03-22
Check for existence of a shape_id for each trip 0 2022-10-17 2022-10-27
Target Temperatures for other temperature sensors 2 2021-08-30 2023-03-21
17/7DA628-0364-4DE8-9B13-2A7F182D22C9 5 2020-02-19 2023-03-12
https://johngrib.github.io/wiki/junit5-nested/ 10 2020-02-21 2022-12-23
[Feature] Any way to grab the script that STL is running? 1 2022-08-10 2023-03-22
SteamDeck - Winetricks list of selected packages is piling up 51 2022-08-12 2023-03-22
Recent update broke cheat engine 4 2022-08-12 2023-03-22
Remove "About Privacy Guides" section on homepage 0 2022-09-16 2023-02-28
BLE connectivity reliability analysis 29 2021-02-12 2023-02-25
add `proxy` support for `java.io.PipedInputStream` and `java.io.PipedOutputStream`. Add reflection for `java.utils.Scanner` 0 2022-03-31 2023-02-10
Allow customization of itemsKeepDays via command line flags 1 2022-06-02 2023-02-07
MultiMC fails to launch Minecraft on arm64 platform 2 2022-11-20 2023-03-22
回包的时候不定期core,请问有遇到过么(MySQL client)? 26 2021-12-12 2023-03-22
Tapo Cams von TP-Link steuern (Video ist nicht notwendig) 8 2021-07-11 2023-03-06
cmake issue with v2.2.2 4 2020-12-10 2023-03-21
Pressing Esc doesn't cause editor to enter normal mode 2 2021-10-05 2023-02-11
Crash when Notes are copied same as #552 1 2022-01-18 2023-03-22
Trim CSS ID field value 0 2021-12-12 2023-01-25
[MU4 Issue] Playback setup in Mixer becomes greyed out after reopening MU and score with previously opened Mixer 3 2022-10-17 2023-02-04
Problem with pyproj 3.4.0 , package not found 4 2022-11-07 2023-03-07
Environment variable POETRY_EXPERIMENTAL_SYSTEM_GIT_CLIENT not recognised during poetry install 12 2022-10-06 2023-02-23
Device discovery stopped working / internal server error 9 2021-04-23 2023-03-08
Tramstation Command atmos disconected from the rest of the Station. 0 2023-03-16 2023-03-13
SKUs list Missing MCOMEETACPEA SKUID 3 2022-09-15 2023-02-20
Dataloader and Connections: Couldn't find a connection wrapper 3 2023-02-22 2023-03-17
SLA Elephant Foot Compensation 1 2022-06-02 2023-02-23
Many readings of zero, leading to few messages 5 2021-08-02 2023-02-10
Monster hp not synced properly 0 2021-10-13 2022-11-05
Packed, and then unpacked EXE crashes 9 2017-03-17 2023-02-20
WaitForSingleObject seems to receive a key release event without releasing the key 1 2022-08-12 2023-02-04
remove duplicate include 2 2021-12-15 2022-09-01
HTMLdump OpActivity page has no link to OpInteractions 1 2021-01-08 2023-03-16
Some CSI packets have the wrong length 0 2022-09-19 2023-02-03
两个节点之间的连线不重叠 3 2021-12-15 2022-01-20
[QUESTION] How to mock Blob Client in Unit Tests? 4 2022-02-04 2023-03-22
第三章 逐元操作错误 1 2019-03-27 2022-01-23
code opmization 0 2021-06-18 2022-01-08
Arrow serializer 2 2021-03-01 2022-01-14
RecyclerView in RecyclerView with FlexboxLayoutManager only show one line 9 2017-06-03 2023-03-22
No detect_offensive_language argument command 4 2021-10-03 2023-02-07
tinymce 5.x autosave plugins can cause memory leak 1 2022-11-08 2023-02-09
Export dashboards to external website without iframe 1 2022-04-04 2022-12-21
Bump `rust-android-gradle` to version 0.9.0+ 2 2021-08-25 2023-01-25
Move off deprecated GoogleCredential IAM authentication method to IAM credentials 7 2020-12-01 2023-03-22
How are duplicate values in IncrementalValuesProvider handled? 3 2022-03-20 2023-02-08