aboutsummaryrefslogtreecommitdiff
path: root/toys/posix/date.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/posix/date.c')
-rw-r--r--toys/posix/date.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/toys/posix/date.c b/toys/posix/date.c
index 99a41695..5a0f27e1 100644
--- a/toys/posix/date.c
+++ b/toys/posix/date.c
@@ -7,7 +7,7 @@
* Note: setting a 2 year date is 50 years back/forward from today,
* not posix's hardwired magic dates.
-USE_DATE(NEWTOY(date, "d:D:I(iso)(iso-8601):;r:s:u(utc)[!dr]", TOYFLAG_BIN))
+USE_DATE(NEWTOY(date, "d:D:I(iso-8601):;r:s:u(utc)[!dr]", TOYFLAG_BIN))
config DATE
bool "date"
@@ -156,7 +156,7 @@ void date_main(void)
struct tm tm = {};
char *s = strptime(TT.d, TT.D+(*TT.D=='+'), &tm);
- t = (s && *s) ? xvali_date(&tm, s) : xvali_date(0, TT.d);
+ t = (s && !*s) ? xvali_date(&tm, s) : xvali_date(0, TT.d);
} else parse_date(TT.d, &t);
} else {
struct timespec ts;