home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 15 / CDACTUAL15.iso / cdactual / program / c / WTIME.ZIP / WTIME.DOC next >
Encoding:
Text File  |  1992-10-05  |  7.7 KB  |  150 lines

  1.  
  2. WTIME.EXE  (Version 1.0)               Copyright (c) 1992 John Deurbrouck
  3. -------------------------------------------------------------------------
  4.               First Published in PC Magazine October 27, 1992 (Utilities)
  5. -------------------------------------------------------------------------
  6.  
  7. WTIME:
  8.  
  9.       WTIME uses your modem to synchronize the clock in your PC with
  10. that of the Automatic Computer Time Service (ACT), which is maintained
  11. by the National Institute of Standards and Technology.  This program can
  12. be run under Windows 3.x or OS/2's Windows implementation. With a click
  13. of the mouse, a call taking less than 1 minute will ensure that your
  14. date/time stamp is accurate.  If you wish, you can even have WTIME make
  15. the call automatically each time you bring up Windows.
  16.  
  17. To recompile the C source code, you'll need Microsoft Quick C for Windows,
  18. Version 1.0; Microsoft C++, Version, 7.0; Borland C++, Version 3.0; or
  19. Borland's Turbo C++ for Windows, Version 1.0.
  20.  
  21. USING WTIME
  22.  
  23.      In order to install WTIME, you will need to copy two files--WTIME.EXE
  24. and WTIME.HLP--into a directory where Windows can find them.  You can run
  25. WTIME with Windows' File Run command in the Program Manager, or you can add
  26. WTIME to a Program Manager group by using File New.  Note that if you later
  27. decide that you want to run the program every time you load Windows, you
  28. simply need to change the WTIME on the command line to WTIME automatic. 
  29.  
  30.      When started, WTIME displays a conventional window with three
  31. submenus: File, Modem, and Help.  The first time you use the program you
  32. must begin by selecting Modem Setup, which allows you to configure WTIME.
  33. (The Modem Call and Modem Hangup options are initially grayed out.)
  34. I'll discuss the configuration process below, but since it takes longer
  35. to describe than to do, let me start with how WTIME works once your
  36. modem is ready to use it.
  37.  
  38.      Setting the time could hardly be simpler: When you select Modem
  39. Call, WTIME does the rest. If you have an external modem, you can monitor
  40. the program's progress by watching your modem's lights. In any case,
  41. you'll see the succession of messages that WTIME puts up in its window
  42. (``sending escape sequence,'' ``looking for data,'' and so on). And if
  43. you keep Windows' CLOCK visible at the same time, you'll shortly see it
  44. jump to the correct time at the instant WTIME sets it.  WTIME will then
  45. automatically send an escape sequence in order to terminate the call.
  46.  
  47.      While a call is in progress, you can cancel it at any time by
  48. selecting Modem Hang Up. Selecting File Exit (the only option under the
  49. File menu heading) or double-clicking the system menu will shut down
  50. the program; if a call is in progress, WTIME will not exit until the
  51. modem is properly reset.
  52.  
  53.      When using WTIME, you may notice one minor bug in Windows 3.1's CLOCK.
  54. If the digital clock display is active and the time shifts from an hour
  55. that has two digits (for example, 10:02) to one with one digit
  56. (such as 9:59), CLOCK does not always erase the leading digit.  Thus,
  57. in this case, the display may end up reading 19:59.  Just resize the
  58. window slightly to force a redraw and the superfluous digit will
  59. disappear.
  60.  
  61. SETTING UP WTIME
  62.  
  63.      The Modem Setup dialog box, lets you configure WTIME for your time
  64. zone, daylight saving time preference, dial string, and COM port.
  65.  
  66.      WTIME's time zone setting, including (when applicable) an X in the
  67. Daylight Savings Time box, reflects the difference between your local
  68. time and the Greenwich mean time (GMT), which the ACTS reports.
  69. The menu choices--eastern, central, mountain, and Pacific--cover most
  70. readers' locales.  Saving your choice changes the TimeOffset entry in
  71. the [WTime] section that WTIME creates in your WIN.INI file.  The
  72. TimeOffset entry simply expresses the number of minutes by which your
  73. time zone differs from that of the GMT.
  74.  
  75.      If you don't live in one of the preprogrammed time zones, you can
  76. still use WTIME by changing the TimeOffset number in WIN.INI with a text
  77. editor.  Newfoundland, for example, is 90 minutes in advance of eastern
  78. time. Since the EST TimeOffset is -300, setting TimeOffset to -210
  79. configures WTIME for Newfoundland.  Similarly, Alaska's TimeOffset is
  80. -540 (60 minutes behind Pacific time's -480), and Hawaii's is -660
  81. (3 hours, or 180 minutes, behind Pacific time).  With manual editing
  82. you can also intentionally set your clock a bit slow or fast.  The
  83. central time zone's normal TimeOffset, for example, is -360.
  84. If you wanted to set the clock on your PC to run 5 minutes fast, all you
  85. would have to do is set TimeOffset to -355.
  86.  
  87.      Valid values for TimeOffset range from -1439 (23 hours 59 minutes
  88. before the GMT) to 1439 (23 hours 59 minutes after the GMT).  Since
  89. several states and locations outside the United States do not observe
  90. daylight saving time, the WTIME utility provides a Use Daylight Savings
  91. Time check box.
  92.  
  93.      The Modem Dial String control allows you to change the string your
  94. modem uses to dial the ACTS.  WTIME allows a dial string of up to 79
  95. characters.
  96.  
  97.       The default string
  98.  
  99.                           ATDT13034944774
  100.  
  101. should work for most Hayes-compatible modems when you don't need to go
  102. through a PBX.  The AT signals the modem that a command is about to follow.
  103. The DT specifies Touch-tone dialing, and 13034944774 is the phone number
  104. of the atomic clock you want to reach (303-494-4774). You can insert the
  105. hyphens in the actual dial string if you wish; the modem will ignore them.
  106.  
  107.      You can change the dial string.  For older, pulse-dialing systems,
  108. you'll need to change the DT to DP, for example.  To dial 9 and pause
  109. for 2 seconds before actually dialing the phone number, change the dial
  110. string to
  111.  
  112.                           ATDT9,,13034944774
  113.  
  114.     You might also want to add an M (for Mute) before the DT, to produce
  115. silent operation.  Thus your dial string might look like this:
  116.  
  117.                           ATMDT13034944774
  118.  
  119. One beta-tester even charged WTIME calls to his credit card.  This
  120. involved several long sequences of digits separated by series of commas.
  121. If you do this, however, don't forget that anyone looking at your
  122. WIN.INI will see your phone credit card number.
  123.  
  124.      The strings shown above will work for most modems.  You may need to
  125. check your modem's manual for the proper dialing sequence if the default
  126. and modified strings don't work for you.
  127.  
  128.      The last item you need to configure is the COM port.  You may choose
  129. COM1, COM2, COM3, or COM4 as the port to which your modem is attached.
  130. The modem itself must be capable of operating at 1,200 bits per second
  131. (the fastest speed the ACTS currently supports), and Windows must be
  132. configured correctly to handle the port.  If the TERMINAL program that
  133. comes with Windows works on your system, WTIME should handle your modem
  134. without a problem.
  135.  
  136.      At any time, you can choose Reset Defaults, Save Configuration, or
  137. Cancel.  Reset Defaults restores the original modem dial string, sets the
  138. time zone to Eastern, turns on the Daylight Savings Time option, and sets
  139. the COM port to COM1.  Save Configuration writes your selected values to
  140. WIN.INI, and Cancel closes the Setup Modem dialog box without affecting
  141. your existing setup.
  142.  
  143.      You can uninstall WTIME by using NOTEPAD or SYSEDIT to delete the
  144. [WTime] section from WIN.INI.  Then you just delete WTIME.EXE and
  145. WTIME.HLP.  You'll also want to delete WTIME's icon in the Program
  146. Manager if you've set it up there.  This process has been documented in
  147. WTIME's on-line help, and it cleanly eliminates WTIME from your system.
  148. ------------------------------------------------------------------------
  149. John Deurbrouck is a C and 80x86 assembly programmer who works on
  150. PC platforms.