seconds

Package: WA2L/edrc 1.5.57
Section: Library Commands (3)
Updated: 18 March 2007
Index Return to Main Contents

 

NAME

seconds - print seconds since Epoch for a given date and time

 

SYNOPSIS

edrc/lib/seconds [ -h ]

seconds MM/DD/YYYYY hh:mm:ss

 

AVAILABILITY

WA2L/edrc

 

DESCRIPTION

Calculate seconds since the Epoch for a given date and time.

seconds is the inverse function of the timer command.

In conjunction with the timer command, the seconds command can be used to do some date and time calculation.

Use timer to evaluate the seconds since the Epoch for the current moment.

 

OPTIONS

-h
usage message.

YYYYY-MM-DD hh:mm:ss
date and time in format "Year-Month-Day Hour:Minute:Second".

 

ENVIRONMENT

-

 

EXIT STATUS

0
no error.

4
usage displayed.

 

FILES

-

 

EXAMPLES

1) print seconds since Epoch for Sun Mar 18 23:47:05 CET 2007

[ /home/mzv7t0 ]
[ mzv7t0@rh7mzv7t001 ][ksh]: seconds 2007-03-18 23:47:05 

1174258025

2) print date for 1174258025 since the Epoch

[ /home/mzv7t0 ]
[ mzv7t0@rh7mzv7t001 ][ksh]: timer 1174258025 

2007-03-18 23:47:05

3) print seconds since the Epoch of current point in time

[ /home/mzv7t0 ]
[ mzv7t0@rh7mzv7t001 ][ksh]: timer 

1174258402

4) print the date and time when a 72 hour countdown that started at February 1st 2007 at 12:00:00 will end.

[ /home/mzv7t0 ]
[ mzv7t0@rh7mzv7t001 ][ksh]: begin=`seconds 2007-02-01 12:00:00`

[ /home/mzv7t0 ]
[ mzv7t0@rh7mzv7t001 ][ksh]: end=`expr $begin + 72 \* 60 \* 60` 

[ /home/mzv7t0 ]
[ mzv7t0@rh7mzv7t001 ][ksh]: timer $end

2007-02-04 12:00:00

5) same as example 4, but in an one-line statement.

[ /home/mzv7t0 ]
[ mzv7t0@rh7mzv7t001 ][ksh]: \
  timer `expr \`seconds 2007-02-01 12:00:00\` + 72 \* 60 \* 60` 

2007-02-04 12:00:00

 

SEE ALSO

edrcintro(1), date(1), days(3), is_weekend(3), timer(1), expr(1)

 

NOTES

-

 

BUGS

-

 

AUTHOR

seconds was developed by Christian Walther. Send suggestions and bug reports to wa2l@users.sourceforge.net . 

 

COPYRIGHT

Copyright © 2008 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.


 

Index

NAME
SYNOPSIS
AVAILABILITY
DESCRIPTION
OPTIONS
ENVIRONMENT
EXIT STATUS
FILES
EXAMPLES
SEE ALSO
NOTES
BUGS
AUTHOR
COPYRIGHT

This document was created by man2html using the manual pages.
Time: 16:54:23 GMT, August 28, 2024