Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Up05/odin-RFC-3339-date-parser
https://github.com/Up05/odin-RFC-3339-date-parser
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/Up05/odin-RFC-3339-date-parser
- Owner: Up05
- Created: 2024-04-20T19:01:20.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-04-27T11:02:04.000Z (8 months ago)
- Last Synced: 2024-04-27T12:21:18.134Z (8 months ago)
- Language: Odin
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-odin - RFC 3339 Date Parser
- awesome-odin - RFC 3339 Date Parser
README
# odin-RFC-3339-date-parser
Parser for the [RFC 3339 date & time spec](https://datatracker.ietf.org/doc/html/rfc3339) written in odin.
I mainly wrote this for my TOML parser, so you're allowed to have just the date or just the time, or NOTHING AT ALLLLL.And by the way, it probably works.
```odin
import dates "RFC_3339_date_parser"
// ...
date, err := dates.from_string("1996-02-29 16:39:57-08:00")
fmt.println(dates.to_string(date)) // prints: 1996-02-29 16:39:57-08:00 NONEassert(dates.is_date_lax("1996-02-29 doesn't matter")) // quickly determines if some
assert(dates.is_date_lax("96:02:29 doesn't matter")) // string looks like a date
```