From d393c00c6cd57ef7f122f4e1730b3c410b6084cb Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 5 Jan 2019 21:32:23 +0000 Subject: 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 --- include/timeutils.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') 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 -- cgit v1.2.3-55-g7522