Author Topic: "Weather Display weather data Not Current"  (Read 184 times)

0 Members and 1 Guest are viewing this topic.

Offline K6GKM

  • CamWX.com Admin
  • Member
  • *
  • Posts: 21
    • CamWX
"Weather Display weather data Not Current"
« on: June 20, 2020, 12:38:48 PM »
Hello all,

I have an interesting mystery involving timestamps and date formats on my Saratoga / Weather-Display template site. 

Issue #1 - https://camwx.com/wxstatus.php is showing that my Weather Display weather data is out of date.  My testtags.php is uploading on schedule every 5 minutes, and as best I can tell, the $date and $time contained therein are correct, which is what include-wxstatus.php tests for, if I'm reading my PHP correctly.

Issue #2 - All the variables on my https://camwx.com/wxtrends.php page are showing correctly except for one: Date of last rainfall (never mind the old data warning at the top due to the perviously mentioned out-of-date weather data).  It should be 5 June, 2020.  But instead it's showing 6 May, 2020, which is 6/5/2020 inverted.  I double-checked all the date/time variables in my settings.php, and they all look exactly correct.  I even checked the unit settings in my Weather-Display program control panel to be sure it was formatting the date correctly when it created a testtags file.

I'm stumped.  Pertinent script files included. Any input is appreciated!

Thanks,
Grant


Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 7912
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: "Weather Display weather data Not Current"
« Reply #1 on: June 20, 2020, 06:40:36 PM »
Re (1) the data out of date.
Your testtags.php shows
Code: [Select]
$time =  '3:30 PM'; // current time
$date =  '6/20/2020'; // current date
while your Settings.php shows
Code: [Select]
$SITE['WDdateMDY'] = false; // for WD date format of month/day/year.  =false for day/month/year
  Since your date format is mm/dd/yyyy, change that to
Code: [Select]
$SITE['WDdateMDY'] = true; // for WD date format of month/day/year.  =false for day/month/year
and that will fix the date issue.

for (2), the testags.php shows
Code: [Select]
$dateoflastrainalways = '6/5/2020';
If you change the $SITE['WDdateMDY'] in Settings.php per the above, that will be shown correctly also (as June 5, 2020) instead of May 6, 2020.

One setting to rule them all...
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline K6GKM

  • CamWX.com Admin
  • Member
  • *
  • Posts: 21
    • CamWX
Re: "Weather Display weather data Not Current"
« Reply #2 on: June 20, 2020, 07:16:27 PM »
That variable in settings.php had eluded me!  I knew it had to be something simple.   #-o

Thanks, Ken. 

-Grant