summaryrefslogtreecommitdiffstats
path: root/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'format.c')
-rw-r--r--format.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/format.c b/format.c
index ae3086d1..6f042f8a 100644
--- a/format.c
+++ b/format.c
@@ -1482,6 +1482,8 @@ format_expand_time(struct format_tree *ft, const char *fmt, time_t t)
if (fmt == NULL || *fmt == '\0')
return (xstrdup(""));
+ if (t == 0)
+ t = time(NULL);
tm = localtime(&t);
if (strftime(s, sizeof s, fmt, tm) == 0)