timer
Package: WA2L/edrc 1.5.57
Section: General Commands (1)
Updated: 30 April 2023
Index
Return to Main Contents
NAME
timer - print seconds since the Epoch
SYNOPSIS
Version = 1.0.00:
-
edrc/bin/timer
[
-h
]
timer
[ [
-d
]
seconds
]
Version >= 1.0.01:
-
edrc/bin/timer
[
-h
|
-V
]
timer
[ [
-d
]
seconds
|
YYYY-MM-DD
|
"YYYY-MM-DD hh:mm:ss"
]
AVAILABILITY
WA2L/edrc
DESCRIPTION
return the number of seconds since the Epoch or return the
date based on the given number of seconds since the Epoch.
Since version 1.0.01 of the
timer
command,
the Epoch for a given date or date and time can be resolved.
OPTIONS
- -d
-
return the date and time in the standard format as
printed when the
date(1)
command is issued without options.
- seconds
-
seconds to return the date for it. If the
-d
option is not specified, the date is returned in
military format
(YYYY-MM-DD hh:mm:ss).
- YYYY-MM-DD
-
return the Epoch for the given date at
00:00:00.
- "YYYY-MM-DD hh:mm:ss"
-
return the Epoch for the given date and time.
ENVIRONMENT
- $TZ
-
time zone.
EXIT STATUS
- 4
-
usage printed
- 11
-
no error, seconds since Epoch printed.
- 16
-
no error, seconds of given date time printed.
- 20
-
no error, date based on given seconds printed.
- 25
-
no error, date based on given seconds printed in
standard format.
FILES
-
EXAMPLES
The following examples are given as if they are all executed at the same
point in time.
- 1) print the date
-
[ / ]
[ root@acme007 ][*edrc*/bash]: date
Sun Sep 29 22:36:04 CEST 2008
- 2) print seconds since the Epoch
-
[ / ]
[ root@acme007 ][*edrc*/bash]: timer
1222720564
- 3) calculate the timer of yesterday
-
[ / ]
[ root@acme007 ][*edrc*/bash]: expr `timer` - 60 60 24
1222634164
- 4) print the date based on a (calculated) timer
-
[ / ]
[ root@acme007 ][*edrc*/bash]: timer -d 1222634164
Sun Sep 28 22:36:04 2008
- 5) print the date in military format based on a (calculated) timer
-
[ / ]
[ root@acme007 ][*edrc*/bash]: timer 1222634164
2008-09-28 22:36:04
SEE ALSO
edrcintro(1),
date(1),
seconds(3),
days(3)
NOTES
-
BUGS
-
AUTHOR
timer was developed by Christian Walther. Send suggestions
and bug reports to wa2l@users.sourceforge.net .
COPYRIGHT
Copyright © 2023
Christian Walther
This is free software; see
edrc/doc/COPYING
for copying conditions. There is ABSOLUTELY NO WARRANTY; not
even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This document was created by man2html
using the manual pages.
Time: 16:54:41 GMT, August 28, 2024