Blinking snake

Dhour

NAME

dhour - Convert times to decimal and back

SYNTAX

dhour [-h?vsSdDpPmeItV] <time(s)> ... ...

DESCRIPTION

Dhour converts clock times into decimal parts of an hour or day, and vice versa.

OPTIONS

-h
Help, stdout.
-?
Help, stderr.
-v
Verbose.
-s
Input time as hh:mm<:ss>. This is the default input style; the default output format is the same as that for the -D option.
-S
Output format becomes hh:mm:ss.
-d
Input time as hh.nnn; the default output format is the same as that for the -S option.
-D
Output format becomes hh.nnn, or hours and percent of hour. This is the default output format unless otherwise specified.
-p
Input time as 0.nnnn (% of day); the default output format is the same as for the -S option. It is an error if you supply “1.25” as a time (since that’s more than a day), but you may leave out the 0.
-P
Output format becomes 0.nnnn, or percent of a day.
-m
Output format becomes mmmm:ss.
-e
Output format becomes ssss.
-I<file>
Obtain dates/times from <file> instead of from the command line.
-t
If dhour is reading from stdin or /dev/tty, and you have specified this option, it will prompt (“dhour: ”) before reading.
-V
Print version date and die.

EXAMPLES

$ date
Tue Nov 26 16:47:44 MST 1996
$ dhour -v
16.80416667
$ dhour -v
16:48:35 = Tue Nov 26 16:48:35 1996 = 16.80972222
$ dhour -P
0.70069444
$ dhour -p 0.70069444
16:49:00
$ dhour -m
1010:41
$ dhour -e
60662
$ dhour -d 16.98
16:58:48
$  dhour -S
16:52:47
$ dhour -ep 0.70069444
60540
$
  

BUGS & SPECIAL CONSIDERATIONS

The ? in the -? must be escaped (preceded by a \) to prevent interpretation as a metacharacter by some shells.

SEE ALSO

ncal(I), easter(I), jug(I), weekday(I), jday(I), grj(I)

PLATFORMS SUPPORTED

UnixWare®

AUTHOR

Ivan Van Laningham. If you would like the C source, email me.

Previous Page
Table of Contents
Next Page

Main web site:  http://www.pauahtun.org

Valid HTML 4.01 Transitional