Author Topic: Local Time for earthquakes in Saratoga-Weather's quake script is wrong?  (Read 2322 times)

0 Members and 1 Guest are viewing this topic.

Offline anchorageweather

  • Forecaster
  • *****
  • Posts: 445
    • http://eetee.us/station/station.php
Since the recent big earthquake in the midwest, I've had a lot of traffic to my earthquake page at:

http://eetee.us/station/quake-USA-test.php?magnitude=1.0&distance=350

I've received two emails from visitors that let me know the "Local Time" column for the eathquakes is off by one hours.  I've never noticed it before; however, I think the visitors are correct - the time seems off.

I believe I'm using the correct setting for the timezone:

Code: [Select]
$ourTZ = "America/Kentucky/Louisville";
The times say they are listed in EDT, but they seem to be CDT.  I'm wondering if it has something to do with the recent switch in daylight savings time?!?

Finally, I'm using an older version of the script; however, I do not think the newer version has changed the way the script handles the time functions.

Has anyone else noticed this?  Is there a way to correct the time issue?  Thanks for any help?

South of the Tracks, Anchorage, KY

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
There seems to be an issue on some webhosters about the time difference between UTC and Local time.  For EDT, it should be -4 hours.

Your script is showing
Quote
<!-- server lcl time is: Sat, Apr-26-2008 11:34:35 EDT -->
<!-- server GMT time is: Sat, Apr-26-2008 15:34:35 GMT -->
<!-- server timezone for this script is: America/Kentucky/Louisville -->
<!-- TZ Delta = -18000 seconds (-5 hours) -->


Best regards,
Ken

« Last Edit: April 26, 2008, 02:21:12 PM by saratogaWX »
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Found the problem..

You can download a new copy of quake-USA.php from http://saratoga-weather.org/quake-USA.php?sce=view or change your current source from
Code: [Select]
$timediff = tzdelta();
 print "<!-- TZ Delta = $timediff seconds (" . $timediff/3600 . " hours) -->\n";
to
Code: [Select]
$timediff = date("Z");
 print "<!-- TZ Delta = $timediff seconds (" . $timediff/3600 . " hours) -->\n";
and that should fix the issue.

Best regards,
Ken
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline anchorageweather

  • Forecaster
  • *****
  • Posts: 445
    • http://eetee.us/station/station.php
Found the problem..

You can download a new copy of quake-USA.php from http://saratoga-weather.org/quake-USA.php?sce=view or change your current source from
Code: [Select]
$timediff = tzdelta();
 print "<!-- TZ Delta = $timediff seconds (" . $timediff/3600 . " hours) -->\n";
to
Code: [Select]
$timediff = date("Z");
 print "<!-- TZ Delta = $timediff seconds (" . $timediff/3600 . " hours) -->\n";
and that should fix the issue.

Best regards,
Ken

Ken:

As always, thanks for your help!  =D&gt;
South of the Tracks, Anchorage, KY

 

anything