JKISoftware / JKI-JSON-Serialization

JSON Serialization & Deserialization Library for LabVIEW
http://jki.net/tools#json
BSD 3-Clause "New" or "Revised" License
25 stars 9 forks source link

"ISO String To Timestamp.vi" doesn't support date strings #22

Closed rockethacker closed 7 years ago

rockethacker commented 7 years ago

Your timestamp serialization/deserialization fucntions mention that they convert "ISO" timestamps, but they only provide partial coverage of the ISO-8601 standard. The 1.1.7.33 release addresses a little more of the spec, but it still isn't enough for my use case (JIRA API) where a date but not a time is provided:

2016-12-22

According to the wikipedia page, this should be valid ISO-8601 https://en.wikipedia.org/wiki/ISO_8601

Optimally, you should use an off the shelf ISO-8601 converter that supports more of the spec, but it doesn't appear that one exists (maybe a good candidate for an OpenG function?).

drjdpowell commented 7 years ago

Comment: I also have multiple packages that try to use ISO-8601 for timestamps (SQLite Library, for example) and it would be nice if there was a common ISO-8601 parser that we could all use. Currently I just use trial-and-error with a number of common specific formats.

jimkring commented 7 years ago

For what it's worth @rockethacker @drjdpowell, the JKI EasyXML library has a ISO-8601 converter that seems to work pretty well for the 2016-12-22 string, but not the more complex ones:

vi.lib\addons_JKI Toolkits\EasyXML\JKI_EasyXML.llb\Parse XML dateTime String__JKI EasyXML.vi

jimkring commented 7 years ago

I've implemented a fix for supporting date strings without time (e.g. "2016-12-22")