aboutsummaryrefslogtreecommitdiff
path: root/toys/other
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-06-28 16:57:21 -0700
committerRob Landley <rob@landley.net>2018-07-04 14:24:24 -0500
commit4d673c9ad4c65c329a85ebb19c2812ae93183099 (patch)
tree0dba43542152b2f06805340104bf25390193cf51 /toys/other
parent7771e94e2a082726142387476937d7f136f65147 (diff)
downloadtoybox-4d673c9ad4c65c329a85ebb19c2812ae93183099.tar.gz
diff: add timestamps to the ---/+++ lines and --color.
(My apologies for mixing these two unrelated changes up.)
Diffstat (limited to 'toys/other')
-rw-r--r--toys/other/stat.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/toys/other/stat.c b/toys/other/stat.c
index f68704dd..a1233650 100644
--- a/toys/other/stat.c
+++ b/toys/other/stat.c
@@ -67,11 +67,7 @@ static void strout(char *val)
static void date_stat_format(struct timespec *ts)
{
- char *s = toybuf+128;
- strftime(s, sizeof(toybuf)-128, "%Y-%m-%d %H:%M:%S",
- localtime(&(ts->tv_sec)));
- sprintf(s+strlen(s), ".%09ld", ts->tv_nsec);
- strout(s);
+ strout(format_iso_time(toybuf+128, sizeof(toybuf)-128, ts));
}
static void print_stat(char type)