diff options
-rw-r--r-- | coreutils/date.c | 1 | ||||
-rw-r--r-- | libbb/time.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/coreutils/date.c b/coreutils/date.c index dfc1c7663..7061f1719 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
@@ -111,6 +111,7 @@ | |||
111 | //usage: ) | 111 | //usage: ) |
112 | //usage: "\n" | 112 | //usage: "\n" |
113 | //usage: "\nRecognized TIME formats:" | 113 | //usage: "\nRecognized TIME formats:" |
114 | //usage: "\n @seconds_since_1970" | ||
114 | //usage: "\n hh:mm[:ss]" | 115 | //usage: "\n hh:mm[:ss]" |
115 | //usage: "\n [YYYY.]MM.DD-hh:mm[:ss]" | 116 | //usage: "\n [YYYY.]MM.DD-hh:mm[:ss]" |
116 | //usage: "\n YYYY-MM-DD hh:mm[:ss]" | 117 | //usage: "\n YYYY-MM-DD hh:mm[:ss]" |
diff --git a/libbb/time.c b/libbb/time.c index e66a9cba8..86b88a414 100644 --- a/libbb/time.c +++ b/libbb/time.c | |||
@@ -90,7 +90,11 @@ void FAST_FUNC parse_datestr(const char *date_str, struct tm *ptm) | |||
90 | ptm->tm_mon -= 1; /* Adjust month from 1-12 to 0-11 */ | 90 | ptm->tm_mon -= 1; /* Adjust month from 1-12 to 0-11 */ |
91 | } else | 91 | } else |
92 | if (date_str[0] == '@') { | 92 | if (date_str[0] == '@') { |
93 | time_t t = bb_strtol(date_str + 1, NULL, 10); | 93 | time_t t; |
94 | if (sizeof(t) <= sizeof(long)) | ||
95 | t = bb_strtol(date_str + 1, NULL, 10); | ||
96 | else /* time_t is 64 bits but longs are smaller */ | ||
97 | t = bb_strtoll(date_str + 1, NULL, 10); | ||
94 | if (!errno) { | 98 | if (!errno) { |
95 | struct tm *lt = localtime(&t); | 99 | struct tm *lt = localtime(&t); |
96 | if (lt) { | 100 | if (lt) { |