https://github.com/mlabbe/c_date_parse
Parse ISO8601 date strings in C
https://github.com/mlabbe/c_date_parse
Last synced: about 1 year ago
JSON representation
Parse ISO8601 date strings in C
- Host: GitHub
- URL: https://github.com/mlabbe/c_date_parse
- Owner: mlabbe
- License: gpl-2.0
- Archived: true
- Created: 2016-05-28T22:43:03.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-28T22:44:25.000Z (about 10 years ago)
- Last Synced: 2025-02-15T22:42:08.259Z (over 1 year ago)
- Language: C
- Size: 17.6 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# Date parsing in C #
*Library quality: works after hacking*
This code is able to parse dates in C and display them in a number of formats. It was ripped from Git, and as such, is available under the GPLv2.
It also depends on a bunch of posix-like things and is not cross platform. But, if you are working on a Linux (possibly Mac?) program that needs powerful date parsing and can tolerate the GPLv2, this will do the trick.
## Notes ##
- Compiles with --std=gnu89, so just add the .c and the .h to your project.
- See the main() at the bottom for possible usage demonstration.
- This was done because the author needed ISO8601 date parsing in C. Not much else is tested.
- Git uses `struct strbuf` strings, but these were replaced with char * to reduce the amount of things I had to pull in.
- `DATE_PARSE_ENABLE` is an #ifdef guard which excludes parts of the code I didn't port.
- It works.