summaryrefslogtreecommitdiffstats
path: root/src/datetime.c
Commit message (Collapse)AuthorAgeFilesLines
* datetime, main: Translate stringsP. J. McDermott2023-10-061-6/+7
|
* datetime: Drop newly unused use of timegm()P. J. McDermott2022-03-291-22/+0
| | | | It's non-standard.
* datetime: Get target (struct tm *) from callerP. J. McDermott2022-03-291-18/+18
|
* datetime: Use difftime() in normalizationP. J. McDermott2022-03-281-2/+2
|
* datetime: Don't use mktime()/localtime() shortcutsP. J. McDermott2022-03-281-16/+30
|
* datetime: Change sanity checksP. J. McDermott2022-03-231-4/+4
| | | | | | Check if the year is earlier than 1900 instead of 1970. Step one of eliminating timegm().
* datetime: s/ ;/;/P. J. McDermott2022-03-231-2/+2
|
* datetime: Add glibc timegm() feature test macrosP. J. McDermott2022-03-221-0/+3
|
* Update copyright yearsP. J. McDermott2022-03-221-1/+1
|
* datetime, formats: Conform to strptime() space reqP. J. McDermott2022-03-221-9/+36
|
* datetime: Fix initial formatting buffer sizeP. J. McDermott2022-03-221-1/+1
|
* datetime: Don't forget to copy NUL chars to bufferP. J. McDermott2022-03-221-6/+6
|
* datetime: Copy time-only & misc formats to bufferP. J. McDermott2022-03-221-3/+12
|
* datetime: Move formats into another fileP. J. McDermott2022-03-211-194/+25
|
* datetime: Print full weekday and month namesP. J. McDermott2022-03-201-0/+96
|
* datetime: Lengthen commentsP. J. McDermott2022-03-201-46/+46
|
* datetime: Add formats with "."P. J. McDermott2022-03-201-0/+7
|
* datetime: Sanity check parsing resultsP. J. McDermott2022-03-191-11/+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 EpochP. J. McDermott2022-03-191-0/+22
| | | | And use it in main().
* datetime: Update new _datetime_normalize() callP. J. McDermott2022-03-191-1/+1
|
* Merge branch 'feature/tests'P. J. McDermott2022-03-191-14/+6
|\
| * datetime: Get now (struct tm) from callerP. J. McDermott2022-03-181-11/+6
| |
| * datetime: Move & unify time() & localtime() callsP. J. McDermott2022-03-181-6/+3
| |
* | datetime: Try time-only formats only onceP. J. McDermott2022-03-181-1/+10
|/
* datetime: Collapse spaces after strftime()P. J. McDermott2021-09-011-20/+29
| | | | Turns "Sep 1" into "Sep 1".
* datetime: Free fmt bufs when iterators reach endP. J. McDermott2021-08-311-3/+19
| | | | Simplifies caller code.
* datetime: Replace %d with %e in some formatsP. J. McDermott2021-08-311-12/+12
|
* Add option to list supported formatsP. J. McDermott2021-08-311-8/+116
|
* datetime: Find ends of arrays with sizeof()P. J. McDermott2021-08-311-10/+12
| | | | | | | | | | | | Before: $ wc -c @ 61256 @ After: $ wc -c @ 60616 @
* datetime: Add UNIX-like date formatP. J. McDermott2021-08-311-0/+2
|
* datetime: Replace goto with function callsP. J. McDermott2021-08-301-66/+72
| | | | | goto is fine, but this splits up a function that had grown a little long.
* datetime: Replace unnecessary fprintf with fputsP. J. McDermott2021-08-301-1/+1
|
* datetime: Replace large list of formatsP. J. McDermott2021-08-301-13/+131
|
* datetime: Support weekday-only datesP. J. McDermott2021-08-291-2/+18
|
* datetime: Init all relevant struct tm membersP. J. McDermott2021-08-291-4/+11
|
* datetime: Make year optionalP. J. McDermott2021-08-291-5/+17
|
* datetime: Remove debugging outputP. J. McDermott2021-08-291-5/+0
|
* Move concatenation functionP. J. McDermott2021-08-291-48/+3
|
* Add loop, adjust datetime_parse() param and declsP. J. McDermott2021-08-291-16/+24
|
* datetime: Minor cleanupP. J. McDermott2021-08-291-2/+2
|
* datetime: Further implementP. J. McDermott2021-08-291-47/+68
| | | | | Simplify concatenation, factor out formats, and determine date if not specified.
* datetime: WIPP. J. McDermott2021-08-291-0/+104