summaryrefslogtreecommitdiffstats
path: root/src/main.c
Commit message (Collapse)AuthorAgeFilesLines
* main: Add undocumented debugging optionP. J. McDermott2022-03-171-3/+28
| | | | | Prints the number of seconds between the UNIX epoch and the specified time.
* main: Make (struct option) variable static constP. J. McDermott2022-03-171-1/+1
|
* main: Use difftime() instead of comparing time_tP. J. McDermott2022-03-161-4/+4
| | | | | | | | | | 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
* main: Skip empty formatsP. J. McDermott2021-09-011-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. McDermott2021-09-011-4/+4
| | | | Turns "Sep 1" into "Sep 1".
* datetime: Free fmt bufs when iterators reach endP. J. McDermott2021-08-311-30/+3
| | | | Simplifies caller code.
* Add option to list supported formatsP. J. McDermott2021-08-311-4/+74
|
* main: Handle optionsP. J. McDermott2021-08-311-3/+90
|
* main: Fix exit status on buffer alloc failureP. J. McDermott2021-08-311-1/+1
| | | | Fixes an issue in code moved in commit ad183ca4.
* main: Prevent dates too large to consistently showP. J. McDermott2021-08-291-2/+8
|
* Move concatenation functionP. J. McDermott2021-08-291-4/+48
|
* main: Improve outputP. J. McDermott2021-08-291-4/+5
|
* Add loop, adjust datetime_parse() param and declsP. J. McDermott2021-08-291-5/+17
|
* datetime: Further implementP. J. McDermott2021-08-291-3/+26
| | | | | Simplify concatenation, factor out formats, and determine date if not specified.
* datetime: WIPP. J. McDermott2021-08-291-0/+11
|
* Initial commitP. J. McDermott2021-08-281-0/+5