Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/date date(1): add example for how to get seconds since t...



details:   https://anonhg.NetBSD.org/src/rev/0ad6f233a243
branches:  trunk
changeset: 366021:0ad6f233a243
user:      wiz <wiz%NetBSD.org@localhost>
date:      Tue May 10 05:37:33 2022 +0000

description:
date(1): add example for how to get seconds since the Epoch output

diffstat:

 bin/date/date.1 |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (41 lines):

diff -r ea166231462c -r 0ad6f233a243 bin/date/date.1
--- a/bin/date/date.1   Tue May 10 00:54:00 2022 +0000
+++ b/bin/date/date.1   Tue May 10 05:37:33 2022 +0000
@@ -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 @@
 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 @@
 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.



Home | Main Index | Thread Index | Old Index