aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-01-17 14:23:42 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-01-17 14:23:42 +0100
commit10ee20b58b77bdfb941480fdf4b95347c2b2ea79 (patch)
treed1d36427d955a638f6e20f45ef16bc8fb8d22044
parentad3d72f082cbdb152837ae87d1d285cbbf67913a (diff)
downloadbusybox-10ee20b58b77bdfb941480fdf4b95347c2b2ea79.tar.gz
libbb: better comment in parse_date
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--libbb/time.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libbb/time.c b/libbb/time.c
index 1eb2d75c2..e2b938471 100644
--- a/libbb/time.c
+++ b/libbb/time.c
@@ -91,7 +91,13 @@ void FAST_FUNC parse_datestr(const char *date_str, struct tm *ptm)
* .SS Seconds, a number from 0 to 61 (with leap seconds)
* Everything but the minutes is optional
*
- * This coincides with the format of "touch -t TIME"
+ * "touch -t DATETIME" format: [[[[[YY]YY]MM]DD]hh]mm[.ss]
+ * Some, but not all, Unix "date DATETIME" commands
+ * move [[YY]YY] past minutes mm field (!).
+ * Coreutils date does it, and SUS mandates it.
+ * (date -s DATETIME does not support this format. lovely!)
+ * In bbox, this format is special-cased in date applet
+ * (IOW: this function assumes "touch -t" format).
*/
unsigned cur_year = ptm->tm_year;
int len = strchrnul(date_str, '.') - date_str;