]> git.ipfire.org Git - thirdparty/util-linux.git/commit
timeutils: match today day and this year correctly
authorSami Kerola <kerolasa@iki.fi>
Sat, 5 Jan 2019 21:32:23 +0000 (21:32 +0000)
committerSami Kerola <kerolasa@iki.fi>
Sat, 12 Jan 2019 08:46:29 +0000 (08:46 +0000)
commitd393c00c6cd57ef7f122f4e1730b3c410b6084cb
tree5817b503951f7d57ea37beaeeb697a344cb63f6a
parent1a83c00d888fad89f09c4acf2033790d5dcae48e
timeutils: match today day and this year correctly

Assumption all years since 1970 have been exactly 365 days long has it's
problems when leap years happen.  Lets use struct tm fields that are
provided by localtime_r(), making year and day to be correctly compared even
when it's late new years eve somewhere else than UTC-0.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
include/timeutils.h
lib/timeutils.c