Changeset View
Changeset View
Standalone View
Standalone View
bin/date/date.1
Show All 26 Lines | |||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)date.1 8.3 (Berkeley) 4/28/95 | .\" @(#)date.1 8.3 (Berkeley) 4/28/95 | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd May 31, 2022 | .Dd July 27, 2022 | ||||
.Dt DATE 1 | .Dt DATE 1 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm date | .Nm date | ||||
.Nd display or set date and time | .Nd display or set date and time | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
.\" Display time. | .\" Display time. | ||||
.Nm | .Nm | ||||
▲ Show 20 Lines • Show All 304 Lines • ▼ Show 20 Lines | |||||
.It Ar SS | .It Ar SS | ||||
Seconds, a number from 0 to 60 | Seconds, a number from 0 to 60 | ||||
(59 plus a potential leap second). | (59 plus a potential leap second). | ||||
.El | .El | ||||
.Pp | .Pp | ||||
Everything but the minutes is optional. | Everything but the minutes is optional. | ||||
.Pp | .Pp | ||||
.Nm | .Nm | ||||
understands the time zone definitions in the | understands the time zone definitions from the IANA Time Zone Database, | ||||
.Sy tzdata | .Sy tzdata , | ||||
package located in | located in | ||||
.Pa /usr/share/zoneinfo . | .Pa /usr/share/zoneinfo . | ||||
Time changes for Daylight Saving Time, standard time, leap seconds | Time changes for Daylight Saving Time, standard time, leap seconds | ||||
and leap years are handled automatically. | and leap years are handled automatically. | ||||
.Pp | .Pp | ||||
There are two ways to specify the time zone: | There are two ways to specify the time zone: | ||||
.Pp | .Pp | ||||
If the file or symlink | If the file or symlink | ||||
.Pa /etc/localtime | .Pa /etc/localtime | ||||
exists, it is interpreted as a time zone definition file, usually in | exists, it is interpreted as a time zone definition file, usually in | ||||
the directory hierarchy | the directory hierarchy | ||||
.Pa /usr/share/zoneinfo , | .Pa /usr/share/zoneinfo , | ||||
which contains the time zone definitions from the | which contains the time zone definitions from | ||||
.Sy tzdata | .Sy tzdata . | ||||
package. | |||||
.Pp | .Pp | ||||
If the environment variable | If the environment variable | ||||
.Ev TZ | .Ev TZ | ||||
is set, its value is interpreted as the name of a time zone definition | is set, its value is interpreted as the name of a time zone definition | ||||
file, either an absolute path or a relative path to a time zone | file, either an absolute path or a relative path to a time zone | ||||
definition in | definition in | ||||
.Pa /usr/share/zoneinfo . | .Pa /usr/share/zoneinfo . | ||||
The | The | ||||
▲ Show 20 Lines • Show All 192 Lines • ▼ Show 20 Lines | |||||
command appeared in | command appeared in | ||||
.At v1 . | .At v1 . | ||||
.Pp | .Pp | ||||
A number of options were added and then removed again, including the | A number of options were added and then removed again, including the | ||||
.Fl d | .Fl d | ||||
(set DST flag) and | (set DST flag) and | ||||
.Fl t | .Fl t | ||||
(set negative time zone offset). | (set negative time zone offset). | ||||
Time zones are now handled by the | Time zones are now handled by code bundled with | ||||
.Sy tzdata | .Sy tzdata . | ||||
package. | |||||
.Pp | .Pp | ||||
The | The | ||||
.Fl I | .Fl I | ||||
flag was added in | flag was added in | ||||
.Fx 12.0 . | .Fx 12.0 . |