summaryrefslogtreecommitdiffstats
path: root/login-utils/lslogins.c
diff options
context:
space:
mode:
authorJ William Piggott2017-10-15 02:37:11 +0200
committerJ William Piggott2017-11-10 22:34:55 +0100
commit4111bb3ab5f406ee381a3807385af59fe33b28f3 (patch)
treed03f85ab061bfade57c03c716e5226048fcdc8af /login-utils/lslogins.c
parentlib/timeutils: add get_gmtoff() (diff)
downloadkernel-qcow2-util-linux-4111bb3ab5f406ee381a3807385af59fe33b28f3.tar.gz
kernel-qcow2-util-linux-4111bb3ab5f406ee381a3807385af59fe33b28f3.tar.xz
kernel-qcow2-util-linux-4111bb3ab5f406ee381a3807385af59fe33b28f3.zip
lib/timeutils: add common ISO timestamp masks
* Start the ISO format flags at bit 0 instead of bit 1. * Remove unnecessary _8601 from ISO format flag names to avoid line wrapping and to ease readability. * ISO timestamps have date-time-timzone in common, so move the TIMEZONE flag to bit 2 causing all timestamp masks to have the first three bits set and the last four bits as timestamp 'options'. * Change the 'SPACE' flag to a 'T' flag, because it makes the code and comments more concise. * Add common ISO timestamp masks. * Implement the ISO timestamp masks in all applicable code using the strxxx_iso() functions. Signed-off-by: J William Piggott <elseifthen@gmx.com>
Diffstat (limited to 'login-utils/lslogins.c')
-rw-r--r--login-utils/lslogins.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c
index 1042b9b41..51033b01b 100644
--- a/login-utils/lslogins.c
+++ b/login-utils/lslogins.c
@@ -333,11 +333,10 @@ static char *make_time(int mode, time_t time)
buf, sizeof(buf));
break;
case TIME_ISO:
- rc = strtime_iso(&time, ISO_8601_DATE|ISO_8601_TIME|ISO_8601_TIMEZONE,
- buf, sizeof(buf));
+ rc = strtime_iso(&time, ISO_TIMESTAMP_T, buf, sizeof(buf));
break;
case TIME_ISO_SHORT:
- rc = strtime_iso(&time, ISO_8601_DATE, buf, sizeof(buf));
+ rc = strtime_iso(&time, ISO_DATE, buf, sizeof(buf));
break;
default:
errx(EXIT_FAILURE, _("unsupported time type"));