Index | Thread | Search

From:
K R <daharmasterkor@gmail.com>
Subject:
ts(1): ISO 8601 format support
To:
tech@openbsd.org
Date:
Fri, 28 Jun 2024 11:41:04 -0300

Download raw body.

Thread
Hi,

The attached diff adds ISO 8601 timestamps to ts(1):

vm$ echo logline | ./obj/ts -Z
2024-06-28T14:02:32Z logline

Please feel free to commit it if you find it useful.

As seen above, the timestamp has no fractional seconds.  Not sure if
this is strictly valid according to the standard or if some fraction
of a second must be present.  As an alternative, a version that
includes microseconds was left commented out in the diff.

In base, syslogd(8) (-Z ) displays miliseconds as the seconds
fraction.  touch(1) (-d) takes an optional .frac component of any
size.  newsyslog(8), in the "when" field, takes no fractional seconds.

Thanks,
--Kor