summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSami Kerola2019-01-05 22:32:23 +0100
committerSami Kerola2019-01-12 09:46:29 +0100
commitd393c00c6cd57ef7f122f4e1730b3c410b6084cb (patch)
tree5817b503951f7d57ea37beaeeb697a344cb63f6a /include
parentlogin: add support for login.defs(5) LASTLOG_UID_MAX (diff)
downloadkernel-qcow2-util-linux-d393c00c6cd57ef7f122f4e1730b3c410b6084cb.tar.gz
kernel-qcow2-util-linux-d393c00c6cd57ef7f122f4e1730b3c410b6084cb.tar.xz
kernel-qcow2-util-linux-d393c00c6cd57ef7f122f4e1730b3c410b6084cb.zip
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>
Diffstat (limited to 'include')
-rw-r--r--include/timeutils.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/include/timeutils.h b/include/timeutils.h
index 230e6db5f..95f1b44da 100644
--- a/include/timeutils.h
+++ b/include/timeutils.h
@@ -82,9 +82,6 @@ int strtime_iso(const time_t *t, int flags, char *buf, size_t bufsz);
#define UL_SHORTTIME_THISYEAR_HHMM (1 << 1)
-int time_is_today(const time_t *t, struct timeval *now);
-int time_is_thisyear(const time_t *t, struct timeval *now);
-
int strtime_short(const time_t *t, struct timeval *now, int flags, char *buf, size_t bufsz);
#ifndef HAVE_TIMEGM