Page MenuHomeFreeBSD

date: add -z output_zone option
ClosedPublic

Authored by bapt on May 19 2023, 9:10 AM.
Tags
None
Referenced Files
F97744554: D40159.id122121.diff
Tue, Oct 1, 1:53 AM
F97723212: D40159.diff
Mon, Sep 30, 11:44 PM
Unknown Object (File)
Sun, Sep 29, 9:43 AM
Unknown Object (File)
Sun, Sep 29, 9:16 AM
Unknown Object (File)
Fri, Sep 27, 2:56 AM
Unknown Object (File)
Thu, Sep 26, 4:30 AM
Unknown Object (File)
Wed, Sep 25, 5:59 PM
Unknown Object (File)
Wed, Sep 25, 9:55 AM
Subscribers

Details

Summary

Inpired by OpenBSD date(1), this option allows to do timezone conversion
via the date(1) command.

For example, to determine when the BSDCan livestream begins for me:

$ env -i TZ=EST5EDT date -z Europe/Paris -j 0900

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

bapt requested review of this revision.May 19 2023, 9:10 AM
kib added inline comments.
bin/date/date.c
196
if (outzone != NULL && setenv("TZ", outzone, 1) != 0)
    err(1, "setenv(TZ)");
bcr added a subscriber: bcr.

OK for the man page part.

This revision is now accepted and ready to land.May 19 2023, 1:20 PM
This revision now requires review to proceed.May 19 2023, 2:59 PM
bapt marked an inline comment as done.May 19 2023, 2:59 PM

I think that the man page ought to include the example from the commit message as well, since an idea to use both -z and TZ is not obvious.

This revision is now accepted and ready to land.May 19 2023, 7:01 PM

Add an example in the manpage of the usage of -z option

This revision now requires review to proceed.May 19 2023, 7:08 PM
This revision was not accepted when it landed; it landed in state Needs Review.May 19 2023, 7:10 PM
This revision was automatically updated to reflect the committed changes.