summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorwiz <wiz@NetBSD.org>2022-05-10 05:37:33 +0000
committerwiz <wiz@NetBSD.org>2022-05-10 05:37:33 +0000
commita39440f20c6ca66c2dc200fd611bfb52e7a3343c (patch)
tree0bcfa429371de0d2bd08480080087f5e2be68537 /bin
parent4d5214914bdfdc88b4b888fbde69775f60edbc1d (diff)
date(1): add example for how to get seconds since the Epoch output
Diffstat (limited to 'bin')
-rw-r--r--bin/date/date.113
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/date/date.1 b/bin/date/date.1
index f15119a4c0d..b7a5a8564a8 100644
--- a/bin/date/date.1
+++ b/bin/date/date.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: date.1,v 1.47 2018/01/27 18:59:38 wiz Exp $
+.\" $NetBSD: date.1,v 1.48 2022/05/10 05:37:33 wiz Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -32,7 +32,7 @@
.\"
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
.\"
-.Dd January 25, 2018
+.Dd May 10, 2022
.Dt DATE 1
.Os
.Sh NAME
@@ -61,7 +61,7 @@ way or set the date.
Only the superuser may set the date.
.Pp
The options are as follows:
-.Bl -tag -width Ds
+.Bl -tag -width 12n
.It Fl a
Use
.Xr adjtime 2
@@ -215,6 +215,13 @@ date 1432
sets the time to
.Li "2:32 PM" ,
without modifying the date.
+.Pp
+The command:
+.Bd -literal -offset -indent
+date +%s
+.Ed
+.Pp
+prints the current time as seconds since the Epoch.
.Sh DIAGNOSTICS
Exit status is 0 on success, 1 if unable to set the date, and 2
if able to set the local date, but unable to set it globally.