Blinking snake

Utc

NAME

utc - Set system time from the USNO

SYNTAX

utc [-s] [-d] [-p]

DESCRIPTION

Without arguments, utc obtains the UTC from the gmtime() call, and pretends that it is the US Naval Observatory; it will output the time once per second in the same format that the USNO uses on its dial-up modems. With the -s argument, it reads a USNO format time from stdin, sets the system time accordingly, and exits.

Utc can also be used to produce test input for other programs that use USNO input format, such as usnaval.

OPTIONS

-d
Turn on debugging.
-s
Read from stdin and attempt to set the system time; unless you’re root, this won’t work. You can test this by piping utc without arguments into utc -s. If you are root, then the time is set silently and utc exits.
-p
Read from stdin, assume that the input is USNO time, and print the results in standard ctime() format on stdout.

EXAMPLES

$ date
Wed Nov 27 12:18:20 MST 1996
$ utc
*
50414 332 191842 UTC
*
50414 332 191843 UTC
*
50414 332 191844 UTC
*
50414 332 191845 UTC
*
50414 332 191846 UTC
*
50414 332 191847 UTC
*
50414 332 191848 UTC
...
$ utc | utc -p
Wed Nov 27 12:19:41 1996
$ utc | utc -s
utc: Not privileged
$  utc | utc -dp
tone: *
time: 50414 332 192029 UTC
Wed Nov 27 12:20:29 1996
$
  

BUGS & SPECIAL CONSIDERATIONS

None known.

SEE ALSO

ncal(I), easter(I), weekday(I), jday(I), jug(I), grj(I), day(I), devn(I), usnaval(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