return 0;
}
-int parse_timestamp(const char *t, usec_t *usec)
+static int parse_timestamp_reference(time_t x, const char *t, usec_t *usec)
{
static const struct {
const char *name;
const char *k;
struct tm tm, copy;
- time_t x;
usec_t plus = 0, minus = 0, ret;
int r, weekday = -1;
unsigned i;
assert(t);
assert(usec);
- x = time(NULL);
localtime_r(&x, &tm);
tm.tm_isdst = -1;
return 0;
}
+int parse_timestamp(const char *t, usec_t *usec)
+{
+ return parse_timestamp_reference(time(NULL), t, usec);
+}
+
/* Returns the difference in seconds between its argument and GMT. If if TP is
* invalid or no DST information is available default to UTC, that is, zero.
* tzset is called so, for example, 'TZ="UTC" hwclock' will work as expected.