home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / tech / bd / findtime.pas < prev    next >
Pascal/Delphi Source File  |  1989-07-17  |  1KB  |  62 lines

  1. Unit FindTime; {                                     FindTime.pas
  2. -------------  }
  3. {$N+}
  4. {$E+}
  5.  
  6. Interface {
  7. --------- }
  8.  
  9. Uses DOS,CRT,SysDD;
  10.  
  11. Procedure Find_Local_Time;
  12.  
  13. Implementation {
  14. -------------- }
  15.  
  16.                {Compute Local Time at Other Station Location}
  17.  
  18.  
  19. Procedure Find_Local_Time;
  20.  
  21. Var
  22.   ComputerHour,
  23.   ComputerMinute,
  24.   ComputerSecond,
  25.   ComputerSec100   : Word;
  26.  
  27.  
  28. Begin   {Find_Local_Time}
  29.  
  30.                {Get Your Local Time}
  31.  
  32. GetTime(ComputerHour,ComputerMinute,ComputerSecond,ComputerSec100);
  33.  
  34. YourHour := ComputerHour;  {Convert Word To Integer for computations}
  35. YourMinute := ComputerMinute;
  36. YourSecond := ComputerSecond;
  37. YourSec100 := ComputerSec100;
  38.  
  39.          {Compute UTC Time}
  40.  
  41. UTCHour := YourHour + Your_Time_Corr;
  42.  
  43. If UTCHour >= 24 Then
  44.   UTCHour := UTCHour - 24;
  45. If UTCHour < 24 Then
  46.   IF UTCHour < 0 Then
  47.     UTCHour := UTCHour + 24;
  48.  
  49. { With UTC time, compute time at other station location}
  50.  
  51. OtherHour := UTCHour + Other_Stn_Time_Corr;
  52.  
  53. If OtherHour >= 24 Then
  54.   OtherHour := OtherHour - 24;
  55. If OtherHour < 24 Then
  56.   IF OtherHour < 0 Then
  57.     OtherHour := OtherHour + 24;
  58.  
  59. End; {of Procedure Find_Local_Time}
  60.  
  61. End. {of Unit FindTime}
  62.