summaryrefslogtreecommitdiff
path: root/src/shared/time-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/time-util.c')
-rw-r--r--src/shared/time-util.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/shared/time-util.c b/src/shared/time-util.c
index 3d00b20eec..7f477100b3 100644
--- a/src/shared/time-util.c
+++ b/src/shared/time-util.c
@@ -344,6 +344,19 @@ int parse_timestamp(const char *t, usec_t *usec) {
return r;
goto finish;
+
+ } else if (endswith(t, " ago")) {
+ _cleanup_free_ char *z;
+
+ z = strndup(t, strlen(t) - 4);
+ if (!z)
+ return -ENOMEM;
+
+ r = parse_usec(z, &minus);
+ if (r < 0)
+ return r;
+
+ goto finish;
}
copy = tm;