diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2020-11-28 20:58:42 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2020-11-28 20:58:42 +0100 |
commit | ab6991c6f59ff2960885bbdec57892e9d0f89598 (patch) | |
tree | 24efe3f241f7e0cf12a25839a5823d5748413010 | |
parent | 818a4aa2efdfa81315129b04fc24d86d02d12bca (diff) | |
download | busybox-w32-ab6991c6f59ff2960885bbdec57892e9d0f89598.tar.gz busybox-w32-ab6991c6f59ff2960885bbdec57892e9d0f89598.tar.bz2 busybox-w32-ab6991c6f59ff2960885bbdec57892e9d0f89598.zip |
date: for -uR and -uIh, timezone still have to be shown at +hhmm, not as abbreviation
function old new delta
date_main 963 941 -22
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | coreutils/date.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/coreutils/date.c b/coreutils/date.c index d84e1c31a..d8a2e8618 100644 --- a/coreutils/date.c +++ b/coreutils/date.c | |||
@@ -320,18 +320,16 @@ int date_main(int argc UNUSED_PARAM, char **argv) | |||
320 | i = 8 + 3 * ifmt; | 320 | i = 8 + 3 * ifmt; |
321 | if (ifmt != 0) { | 321 | if (ifmt != 0) { |
322 | /* TODO: if (ifmt==4) i += sprintf(&fmt_dt2str[i], ",%09u", nanoseconds); */ | 322 | /* TODO: if (ifmt==4) i += sprintf(&fmt_dt2str[i], ",%09u", nanoseconds); */ |
323 | format_utc: | ||
324 | fmt_dt2str[i++] = '%'; | 323 | fmt_dt2str[i++] = '%'; |
325 | fmt_dt2str[i++] = (opt & OPT_UTC) ? 'Z' : 'z'; | 324 | fmt_dt2str[i++] = 'z'; |
325 | /* FIXME: %z prints "+hhmm" timezone, but coreutils-8.30 prints "+hh:mm" */ | ||
326 | } | 326 | } |
327 | fmt_dt2str[i] = '\0'; | 327 | fmt_dt2str[i] = '\0'; |
328 | } else if (opt & OPT_RFC2822) { | 328 | } else if (opt & OPT_RFC2822) { |
329 | /* -R. undo busybox.c setlocale */ | 329 | /* -R. undo busybox.c setlocale */ |
330 | if (ENABLE_LOCALE_SUPPORT) | 330 | if (ENABLE_LOCALE_SUPPORT) |
331 | setlocale(LC_TIME, "C"); | 331 | setlocale(LC_TIME, "C"); |
332 | strcpy(fmt_dt2str, "%a, %d %b %Y %H:%M:%S "); | 332 | strcpy(fmt_dt2str, "%a, %d %b %Y %H:%M:%S %z"); |
333 | i = sizeof("%a, %d %b %Y %H:%M:%S ")-1; | ||
334 | goto format_utc; | ||
335 | } else { /* default case */ | 333 | } else { /* default case */ |
336 | fmt_dt2str = (char*)"%a %b %e %H:%M:%S %Z %Y"; | 334 | fmt_dt2str = (char*)"%a %b %e %H:%M:%S %Z %Y"; |
337 | } | 335 | } |