diff options
Diffstat (limited to 'src/shared/time-util.c')
-rw-r--r-- | src/shared/time-util.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/shared/time-util.c b/src/shared/time-util.c index faa3418819..eb5c1ae790 100644 --- a/src/shared/time-util.c +++ b/src/shared/time-util.c @@ -432,6 +432,7 @@ int parse_timestamp(const char *t, usec_t *usec) { * tomorrow (time is set to 00:00:00) * +5min * -5days + * @2147483647 (seconds since epoch) * */ @@ -460,21 +461,23 @@ int parse_timestamp(const char *t, usec_t *usec) { goto finish; } else if (t[0] == '+') { - r = parse_sec(t+1, &plus); if (r < 0) return r; goto finish; - } else if (t[0] == '-') { + } else if (t[0] == '-') { r = parse_sec(t+1, &minus); if (r < 0) return r; goto finish; - } else if (endswith(t, " ago")) { + } else if (t[0] == '@') + return parse_sec(t + 1, usec); + + else if (endswith(t, " ago")) { _cleanup_free_ char *z; z = strndup(t, strlen(t) - 4); |