chiark / gitweb /
time-util: refuse formatting/parsing times that we can't store
authorLennart Poettering <lennart@poettering.net>
Thu, 2 Feb 2017 17:30:29 +0000 (18:30 +0100)
committerSven Eden <yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:58:36 +0000 (17:58 +0200)
commitcb4c5148b5dab1eaf42347bde0368b6df916a206
treeba9ba44d3647b7f5494d924e724ce8e3d640a1d1
parent6357ed92bd48120109f246b34e0fa8977a2caedc
time-util: refuse formatting/parsing times that we can't store

usec_t is always 64bit, which means it can cover quite a number of
years. However, 4 digit year display and glibc limitations around time_t
limit what we can actually parse and format. Let's make this explicit,
so that we never end up formatting dates we can#t parse and vice versa.

Note that this is really just about formatting/parsing. Internal
calculations with times outside of the formattable range are not
affected.
src/basic/time-util.c
src/basic/time-util.h