time-util: extract parse_calendar_date() from sysupdate

Move the YYYY-MM-DD date parsing and validation logic from
sysupdate-resource.c into a shared parse_calendar_date() function
in time-util, so it can be reused by other subsystems.
This commit is contained in:
Dylan M. Taylor
2026-03-18 09:39:06 -04:00
parent fb2cf9f557
commit 770958e24a
4 changed files with 59 additions and 17 deletions
+1
View File
@@ -180,6 +180,7 @@ const char* etc_localtime(void);
int mktime_or_timegm_usec(struct tm *tm, bool utc, usec_t *ret);
int localtime_or_gmtime_usec(usec_t t, bool utc, struct tm *ret);
int parse_calendar_date(const char *s, usec_t *ret);
uint32_t usec_to_jiffies(usec_t usec);
usec_t jiffies_to_usec(uint32_t jiffies);