Page MenuHomeFreeBSD

date: add -z output_zone option
ClosedPublic

Authored by bapt on May 19 2023, 9:10 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 24, 1:08 AM
Unknown Object (File)
Tue, Apr 23, 3:07 AM
Unknown Object (File)
Fri, Apr 5, 7:12 AM
Unknown Object (File)
Sun, Mar 31, 8:54 AM
Unknown Object (File)
Mar 22 2024, 9:31 PM
Unknown Object (File)
Mar 15 2024, 12:50 PM
Unknown Object (File)
Mar 11 2024, 4:48 PM
Unknown Object (File)
Mar 11 2024, 4:48 PM
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.