home *** CD-ROM | disk | FTP | other *** search
- 02/19/90 MRNBSTime - Set your clock by the National Bureau of Standards
-
- This program got its inspiration from a program named "nbstime", written by
- Warren Tucker. The time conversion code is partly Warren's. I thought it
- would be nice to have a similar capability on the Amiga. In keeping with
- the "small and simple is better" philosophy, I didn't load it up with all
- of the serial I/O stuff. MRNBSTime gets its time value from an external
- file (standard input or filename parameter). One would normally invoke
- MRNBSTime from a terminal emulator script (as my example illustrates) or
- from an ARexx program which has access to a serial I/O resource (e.g.
- Larry Phillips' SerMod package). In fact, I was so into the spirit of
- cooperating tasks that MRNBSTime calls the Amiga's Date command to set the
- new system date. Of course, some might suggest that I was just too lazy to
- write the Aztec-AmigaDOS date conversion routines :-). Naw! Well...
-
- MRNBSTime is invoked from the CLI (or suitable scripting program). Its
- command-line options are:
-
- MRNBSTime [ options ] [ filename ] or,
- MRNBSTime [ options ] < filename or, if you use AShell and PIP:
- someprogram | MRNBSTime [ -d delta ] (pipe it in!)
-
- The options (which are optional if you live in Greenwich) may be one or both of these:
-
- -h hours number of hours to add to GMT value (+- 12)
- -m minutes number of minutes to add to GMT value (+- 59);
- if specified, usually -30 or +30
-
- These delta parameters allow you to specify your timezone delta from GMT.
- For instance, if you're in Rhode Island, your delta value (now, anyways) is
- -5. This could very well be derived from an environment variable (probably
- should be). Some examples:
-
- French Polynesia -h -9 -m -30
-
- New England -h -5 (Winter) (I wish they'd repeal this!)
- -h -4 (Summer)
-
- California -h -8
-
- Greenwich, GB (What are you looking for? :-)
-
- Iran -h 3 -m 30
-
- Central Australia -h 9 -m 30
-
-
- The contents of the input file look like this:
-
- *
- 47941 050 212218 UTC
- *
- 47941 050 212219 UTC
- *
- 47941 050 212220 UTC
- *
- ^%$^#&Iax|+$^
- OK
-
- It's quite alright to have some garbage in the file. As long as MRNBSTime
- can recognize one good line, all is well. For the curious, the universal
- time code fields break out to:
-
- Julian Date
- Day in the year
- Time (HHMMSS) (GMT)
- UTC = Magic recognizer cookie
-
- The auto-answer modem (1200 baud) for the National Bureau of Standards is
- at 202-653-0351.
-
- Enjoy! I am placing this program in the public domain. Do whatever you
- want with it. One caveat: I will not be accountable for hugeamongous
- phone bills should you automate this and trust the supplied VT100 script to
- hang up properly. I have a hunch that the line would drop automatically
- after some interval, but I haven't tried it. Be careful!
-
- Oh, by the way... I created this using Manx Aztec C, V5.0. I modified the
- declaration of "fexecl" (in fcntl.h) to take a variable length parameter
- list:
-
- int fexecl(char *file, char *arg0, ... );
-
- The Aztec includes are a little rough (new) and need a thorough grooming.
-
- The VT100 script file requires VT100 release 2.9 and was originally written
- by Tony Sumrall as an example login script. To use the example
- application, do the following:
-
- 1. Copy MRNBSTime to a directory in your search path (e.g. C:).
-
- 2. Copy MRNBSTime.vt100 to your Rexx: directory. If you're on the West
- Coast or some other foreign land, you'll want to add the appropriate
- -d option to the script line that invokes the MRNBSTime.
-
- 3. Start the VT100 emulator.
-
- 4. Select "AREXX Macro" from the "Script" menu.
-
- 5. Type "MRNBSTime" into the script name requester.
-
- 6. Watch your Amiga become a time standard! :-)
-
-
- Mark Rinfret
-