- utc - Set system time from the USNO
- utc [-s] [-d] [-p]
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.
- Turn on debugging.
- 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.
- Read from stdin, assume that the input is USNO time,
and print the results in standard ctime() format on stdout.
Wed Nov 27 12:18:20 MST 1996
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
time: 50414 332 192029 UTC
Wed Nov 27 12:20:29 1996
BUGS & SPECIAL CONSIDERATIONS
- None known.
- Ivan Van Laningham. If you would like the C source, email me.
Main web site: http://www.pauahtun.org