home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 November / PCO_1198.ISO / filesbbs / os2 / os2www.arj / OS2WWW.ZIP / SYS406.R8 / CGI-BIN / TIMEZONE.PL < prev   
Encoding:
Text File  |  1997-02-05  |  870 b   |  47 lines

  1. MAIN:
  2. {
  3.     # Declare the local variables used by this subroutine
  4.  
  5.     my (@local, @gmt, @cs);
  6.  
  7.     # Compute the time zones
  8.  
  9.     @local    = localtime();
  10.     @gmt        = gmtime();
  11.     @cs        = @gmt;
  12.     $cs[2]    = $cs[2] + 2;
  13.     
  14.     if ($cs[2] > 23)
  15.     {
  16.         $cs[2] = $cs[2] - 24;
  17.     }
  18.  
  19.     # Output the CGI headers
  20.  
  21.     print
  22. 'Content-type: text/html
  23.  
  24. ';
  25.  
  26.     # Display the results as an HTML table
  27.  
  28.     print
  29. '<html><body background=/icons/textures/paper.jpg>
  30. <table border=1>
  31. <tr><th colspan=3><h2>Time Zones</h2></th></tr>
  32. <tr>
  33. <td><b>Local</b></td>
  34. <td><b>GMT</b></td>
  35. <td><b>CompuSource</b></td>
  36. </tr>
  37. <tr>';
  38.  
  39.     print sprintf('<td>%02d:%02d:%02d</td>',    $local[2],    $local[1],    $local[0]);
  40.     print sprintf('<td>%02d:%02d:%02d</td>',    $gmt[2],        $gmt[1],        $gmt[0]);
  41.     print sprintf('<td>%02d:%02d:%02d</td>',    $cs[2],        $cs[1],        $cs[0]);
  42.     
  43.     print '</tr></table></body></html>';
  44.  
  45. }
  46.  
  47.