Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | main: Set text domain and locale | P. J. McDermott | 2023-10-06 | 1 | -1/+15 |
| | |||||
* | datetime, main: Translate strings | P. J. McDermott | 2023-10-06 | 1 | -17/+18 |
| | |||||
* | main: Combine help and license puts() calls | P. J. McDermott | 2023-10-06 | 1 | -13/+13 |
| | |||||
* | main: If debugging, print formatted time | P. J. McDermott | 2022-03-29 | 1 | -3/+7 |
| | | | | Not seconds since Epoch. | ||||
* | datetime: Get target (struct tm *) from caller | P. J. McDermott | 2022-03-29 | 1 | -1/+2 |
| | |||||
* | Update copyright years | P. J. McDermott | 2022-03-22 | 1 | -1/+1 |
| | |||||
* | main: Replace strtol() calls with sscanf() | P. J. McDermott | 2022-03-20 | 1 | -25/+8 |
| | |||||
* | Add --disable-tests to shrink executable size | P. J. McDermott | 2022-03-20 | 1 | -5/+21 |
| | |||||
* | main: Update copyright years in version output | P. J. McDermott | 2022-03-19 | 1 | -1/+1 |
| | |||||
* | datetime: Add function to get seconds since Epoch | P. J. McDermott | 2022-03-19 | 1 | -14/+1 |
| | | | | And use it in main(). | ||||
* | 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 | ||||
* | 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 | 1 | -17/+59 |
| | | | | Drop use of faketime in tests. | ||||
* | datetime: Get now (struct tm) from caller | P. J. McDermott | 2022-03-18 | 1 | -7/+11 |
| | |||||
* | main: Add undocumented debugging option | P. J. McDermott | 2022-03-17 | 1 | -3/+28 |
| | | | | | Prints the number of seconds between the UNIX epoch and the specified time. | ||||
* | 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 | 1 | -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 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 | 1 | -4/+4 |
| | | | | Turns "Sep 1" into "Sep 1". | ||||
* | datetime: Free fmt bufs when iterators reach end | P. J. McDermott | 2021-08-31 | 1 | -30/+3 |
| | | | | Simplifies caller code. | ||||
* | Add option to list supported formats | P. J. McDermott | 2021-08-31 | 1 | -4/+74 |
| | |||||
* | main: Handle options | P. J. McDermott | 2021-08-31 | 1 | -3/+90 |
| | |||||
* | main: Fix exit status on buffer alloc failure | P. J. McDermott | 2021-08-31 | 1 | -1/+1 |
| | | | | Fixes an issue in code moved in commit ad183ca4. | ||||
* | main: Prevent dates too large to consistently show | P. J. McDermott | 2021-08-29 | 1 | -2/+8 |
| | |||||
* | Move concatenation function | P. J. McDermott | 2021-08-29 | 1 | -4/+48 |
| | |||||
* | main: Improve output | P. J. McDermott | 2021-08-29 | 1 | -4/+5 |
| | |||||
* | Add loop, adjust datetime_parse() param and decls | P. J. McDermott | 2021-08-29 | 1 | -5/+17 |
| | |||||
* | datetime: Further implement | P. J. McDermott | 2021-08-29 | 1 | -3/+26 |
| | | | | | Simplify concatenation, factor out formats, and determine date if not specified. | ||||
* | datetime: WIP | P. J. McDermott | 2021-08-29 | 1 | -0/+11 |
| | |||||
* | Initial commit | P. J. McDermott | 2021-08-28 | 1 | -0/+5 |