summaryrefslogtreecommitdiffstats
path: root/cmd/zfs
diff options
context:
space:
mode:
authoralex <[email protected]>2020-03-26 23:28:22 +0800
committerGitHub <[email protected]>2020-03-26 08:28:22 -0700
commit1d2ddb9bb9993b9c2e942040d700a4bacd0b205b (patch)
treed6044fd88f9cde0c21fdd09838341615733c2b06 /cmd/zfs
parent652bdc9b0ed73476c4120dc2db16bd2f16f63708 (diff)
zfs_get: change time format string from %k to %H
Issue #10090 reported that snapshots created between midnight and 1 AM are missing a padded zero in the creation property This change fixes the bug reported in issue #10090 where snapshots created between midnight and 1 AM were missing a padded zero in the creation timestamp output. The leading zero was missing because the time format string used `%k` which formats the hour as a decimal number from 0 to 23 where single digits are preceded by blanks[0] and is fixed by changing it to `%H` which formats the hour as 00-23. The difference in output is as below ``` -Thu Mar 26 0:39 2020 +Thu Mar 26 00:39 2020 ``` Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Igor Kozhukhov <[email protected]> Reviewed-by: George Melikov <[email protected]> Signed-off-by: Alex John <[email protected]> Closes #10090 Closes #10153
Diffstat (limited to 'cmd/zfs')
-rw-r--r--cmd/zfs/zfs_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index 2c719fc47..5e5bbc972 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -6207,7 +6207,7 @@ typedef struct holds_cbdata {
size_t cb_max_taglen;
} holds_cbdata_t;
-#define STRFTIME_FMT_STR "%a %b %e %k:%M %Y"
+#define STRFTIME_FMT_STR "%a %b %e %H:%M %Y"
#define DATETIME_BUF_LEN (32)
/*
*