Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | formats: Reformat comment | P. J. McDermott | 2022-03-22 | 1 | -2/+7 |
| | |||||
* | formats: Remove extra space in some misc formats | P. J. McDermott | 2022-03-22 | 1 | -4/+4 |
| | |||||
* | TODO: Add | P. J. McDermott | 2022-03-21 | 1 | -0/+2 |
| | |||||
* | README, build: Generate list of formats | P. J. McDermott | 2022-03-21 | 4 | -74/+25 |
| | |||||
* | build: Simplify dist-hook | P. J. McDermott | 2022-03-21 | 1 | -8/+6 |
| | |||||
* | formats: Add formats with "%a." and "%b." | P. J. McDermott | 2022-03-21 | 3 | -1/+98 |
| | |||||
* | formats: Lengthen date format strings | P. J. McDermott | 2022-03-21 | 1 | -132/+132 |
| | |||||
* | datetime: Move formats into another file | P. J. McDermott | 2022-03-21 | 4 | -195/+217 |
| | |||||
* | TODO: Add | P. J. McDermott | 2022-03-20 | 1 | -0/+4 |
| | |||||
* | datetime: Print full weekday and month names | P. J. McDermott | 2022-03-20 | 2 | -0/+181 |
| | |||||
* | datetime: Lengthen comments | P. J. McDermott | 2022-03-20 | 1 | -46/+46 |
| | |||||
* | datetime: Add formats with "." | P. J. McDermott | 2022-03-20 | 3 | -1/+14 |
| | |||||
* | tests: Add format listing test | P. J. McDermott | 2022-03-20 | 4 | -1/+107 |
| | |||||
* | main: Replace strtol() calls with sscanf() | P. J. McDermott | 2022-03-20 | 3 | -27/+9 |
| | |||||
* | Add --disable-tests to shrink executable size | P. J. McDermott | 2022-03-20 | 5 | -11/+58 |
| | |||||
* | TODO: Add tasks | P. J. McDermott | 2022-03-20 | 1 | -0/+7 |
| | |||||
* | main: Update copyright years in version output | P. J. McDermott | 2022-03-19 | 1 | -1/+1 |
| | |||||
* | datetime: Sanity check parsing results | P. J. McDermott | 2022-03-19 | 2 | -12/+37 |
| | | | | | | | | | | | | | | | | | | | Previously, "0000 1970-01-01" was parsed as 00:00:19 70-01-01. Fixes: not ok 614 - 0000 1970-01-01 FAIL: tests/parse.sh 614 - 0000 1970-01-01 # Failed test '0000 1970-01-01' # got: '-59958143981' # expected: '0' ok 615 - 1970/01/01 0000 PASS: tests/parse.sh 615 - 1970/01/01 0000 not ok 616 - 0000 1970/01/01 FAIL: tests/parse.sh 616 - 0000 1970/01/01 # Failed test '0000 1970/01/01' # got: '-59958143981' # expected: '0' | ||||
* | datetime: Add function to get seconds since Epoch | P. J. McDermott | 2022-03-19 | 3 | -14/+26 |
| | | | | And use it in main(). | ||||
* | datetime: Update new _datetime_normalize() call | P. J. McDermott | 2022-03-19 | 1 | -1/+1 |
| | |||||
* | main: Pass NULL to time() | P. J. McDermott | 2022-03-19 | 1 | -2/+2 |
| | | | | | | | | | | | | | | If the argument points outside the accessible address space, Linux's time() system call returns a negative value. [1] But since this is indistinguishable from a successful report that the time is before the Epoch, glibc never actually sets errno. The Linux man-pages project recommends: "The tloc argument is obsolescent and should always be NULL in new code. When tloc is NULL, the call cannot fail." [2] [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/kernel/time/time.c [2]: https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/commit/man2/time.2?id=300c07ddd873fa1abbff96262ec365271e429dab | ||||
* | Merge branch 'feature/tests' | P. J. McDermott | 2022-03-19 | 11 | -38/+1077 |
|\ | |||||
| * | tests: Print format listing as TAP diagnostics | P. J. McDermott | 2022-03-19 | 1 | -3/+7 |
| | | |||||
| * | main: Populate day of week in "now" time | P. J. McDermott | 2022-03-19 | 1 | -28/+33 |
| | | | | | | | | Needed for format listing. | ||||
| * | main: Allow faking current time | P. J. McDermott | 2022-03-19 | 2 | -20/+62 |
| | | | | | | | | Drop use of faketime in tests. | ||||
| * | datetime: Get now (struct tm) from caller | P. J. McDermott | 2022-03-18 | 3 | -19/+18 |
| | | |||||
| * | datetime: Move & unify time() & localtime() calls | P. J. McDermott | 2022-03-18 | 1 | -6/+3 |
| | | |||||
| * | tests: Use @'s -F option to auto test all fmts | P. J. McDermott | 2022-03-17 | 1 | -79/+20 |
| | | |||||
| * | tests: WIP parse test | P. J. McDermott | 2022-03-17 | 1 | -7/+103 |
| | | |||||
| * | tests: Add (stub) parse test | P. J. McDermott | 2022-03-17 | 4 | -1/+40 |
| | | |||||
| * | tests/aux/tap-functions.sh: Drop `set -x` | P. J. McDermott | 2022-03-17 | 1 | -2/+0 |
| | | |||||
| * | tests/aux/tap-functions.sh: New file from Automake | P. J. McDermott | 2022-03-17 | 2 | -1/+233 |
| | | | | | | | | https://git.savannah.gnu.org/cgit/automake.git/plain/t/ax/tap-functions.sh | ||||
| * | build-aux/tap-driver.sh: New file from Automake | P. J. McDermott | 2022-03-17 | 4 | -1/+662 |
| | | | | | | | | https://git.savannah.gnu.org/cgit/automake.git/plain/lib/tap-driver.sh | ||||
| * | main: Add undocumented debugging option | P. J. McDermott | 2022-03-17 | 2 | -4/+29 |
| | | | | | | | | | | Prints the number of seconds between the UNIX epoch and the specified time. | ||||
* | | README: Fix number of formats | P. J. McDermott | 2022-03-18 | 1 | -1/+1 |
| | | |||||
* | | datetime: Try time-only formats only once | P. J. McDermott | 2022-03-18 | 1 | -1/+10 |
|/ | |||||
* | .gitignore: Exclude *SUMS | P. J. McDermott | 2022-03-17 | 1 | -0/+2 |
| | |||||
* | TODO: Add tasks | P. J. McDermott | 2022-03-17 | 1 | -0/+3 |
| | |||||
* | main: Make (struct option) variable static const | P. J. McDermott | 2022-03-17 | 1 | -1/+1 |
| | |||||
* | main: Use difftime() instead of comparing time_t | P. J. McDermott | 2022-03-16 | 2 | -6/+7 |
| | | | | | | | | | | C99 ยง 7.23.1 defines time_t as an "arithmetic [type] capable of representing times" with "implementation-defined" "range and precision of times representable". It doesn't require that time1 > time0 for time1 later than time0. See also: http://computer-programming-forum.com/47-c-language/8d7dec65bd1ddafe.htm | ||||
* | TODO: New file | P. J. McDermott | 2022-03-16 | 1 | -0/+2 |
| | |||||
* | README: Compare to related programs | P. J. McDermott | 2021-09-01 | 1 | -0/+7 |
| | |||||
* | main: Skip empty formats | P. J. McDermott | 2021-09-01 | 1 | -0/+9 |
| | | | | | | This was previously done in _datetime_strftime() but in a way that would overflow the array if an empty format was at the end. Moving this logic into the caller is safer and makes a little more sense. | ||||
* | datetime: Collapse spaces after strftime() | P. J. McDermott | 2021-09-01 | 2 | -24/+33 |
| | | | | Turns "Sep 1" into "Sep 1". | ||||
* | NEWS, configure.ac: Set version to 1.0.0 | P. J. McDermott | 2021-08-31 | 2 | -2/+2 |
| | |||||
* | datetime: Free fmt bufs when iterators reach end | P. J. McDermott | 2021-08-31 | 2 | -33/+22 |
| | | | | Simplifies caller code. | ||||
* | datetime: Replace %d with %e in some formats | P. J. McDermott | 2021-08-31 | 1 | -12/+12 |
| | |||||
* | Add option to list supported formats | P. J. McDermott | 2021-08-31 | 4 | -14/+204 |
| | |||||
* | datetime: Find ends of arrays with sizeof() | P. J. McDermott | 2021-08-31 | 1 | -10/+12 |
| | | | | | | | | | | | | Before: $ wc -c @ 61256 @ After: $ wc -c @ 60616 @ | ||||
* | datetime: Add UNIX-like date format | P. J. McDermott | 2021-08-31 | 2 | -1/+4 |
| |