Author Topic: Time Zone Change in RSS Advisory script  (Read 4229 times)

0 Members and 1 Guest are viewing this topic.

Offline PSJohn

  • Senior Contributor
  • ****
  • Posts: 157
    • DesertWeather.com
Time Zone Change in RSS Advisory script
« on: December 08, 2007, 06:57:04 PM »
Ken (Saratoga Weather) has a very useful NOAA RSS Advisory script and it works great, but was wondering if its possible to have it display the updated time stamp in a specific timezone and not the default GMT?

thanks
John Slama
Palm Springs, California
Davis Vantage Pro 2, FARS

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Time Zone Change in RSS Advisory script
« Reply #1 on: December 08, 2007, 07:40:00 PM »
John,
The current script just reports what is in the <lastBuildDate></lastBuildDate> in the RSS feed. Like
Code: [Select]
  <lastBuildDate>Sat, 08 Dec 2007 19:28:22 </lastBuildDate> in your current warnings for CAZ061

Since it's a standard GMT formatted date (with the GMT implied), I can add it to the rss-advisory-test-c.php script if you like.  You'll need to set a $timeZone parameter to make it work.

Give me a bit and I'll post an updated script.

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 PSJohn

  • Senior Contributor
  • ****
  • Posts: 157
    • DesertWeather.com
Re: Time Zone Change in RSS Advisory script
« Reply #2 on: December 08, 2007, 07:55:33 PM »
thank you I appreciate it Ken
John Slama
Palm Springs, California
Davis Vantage Pro 2, FARS

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Time Zone Change in RSS Advisory script
« Reply #3 on: December 08, 2007, 08:09:56 PM »
You're welcome John.

Try out

http://saratoga-weather.org/rss-advisory-test-c.php?sce=view

I used it on http://saratoga-weather.org/rss-advisory-test-c.php?zone=caz056 and got
Code: [Select]
Special Weather Statement - Riverside County Mountains (California)

Updated: Sat, 08-Dec-2007 12:03pm PST
COLD STORM SYSTEM MOVING TOWARD SOUTHERN CALIFORNIA...

A COLD STORM SYSTEM WILL MOVE INTO THE CALIFORNIA BIGHT TONIGHT AND
SUNDAY MORNING BRINGING NUMEROUS SHOWERS. INSTABILITY ASSOCIATED
WITH THIS STORM WILL BRING THE CHANCE OF THUNDERSTORMS WITH SMALL
HAIL TONIGHT AND SUNDAY...ALONG WITH ISOLATED FUNNEL CLOUDS AND
WATERSPOUTS OVER THE COASTAL WATERS. THE SNOW LEVEL WILL DROP TO
AROUND 3000 FEET EARLY SUNDAY...AND MAY DROP EVEN LOWER IN HEAVIER
SHOWERS. LIGHT SNOW WILL BE POSSIBLE DOWN TO THE DESERT FLOOR IN THE
HIGH DESERTS.

ADDITIONAL RAINFALL TOTALS WILL BE QUITE VARIABLE DUE TO THE SHOWERY
NATURE OF THE PRECIPITATION WITH AMOUNTS GENERALLY ONE HALF AN INCH
OR LESS...EXCEPT IN SAN DIEGO COUNTY WHERE AMOUNTS OF ONE HALF TO
ONE INCH COULD BE MORE WIDESPREAD WEST OF THE MOUNTAINS BY LATE
SUNDAY. LOCALLY HEAVIER AMOUNTS OF RAIN WILL BE POSSIBLE IN
CONVECTION AND WHERE SHOWERS PERSIST OVER THE SAME AREA. SNOWFALL
COULD BE LOCALLY HEAVY IN THE SAN DIEGO MOUNTAINS DEPENDING ON THE
TRACK OF THE SURFACE LOW PRESSURE CENTER...BUT GENERALLY SIX INCHES
OR LESS IS EXPECTED...WITH THE LOWER AMOUNTS MORE LIKELY FOR THE
RIVERSIDE AND SAN BERNARDINO MOUNTAINS.

HEAVY SHOWERS COULD CAUSE LOCAL DEBRIS FLOWS...MUD SLIDES AND
FLOODING IN AND BELOW RECENTLY BURNED AREAS...ON STEEP TERRAIN AND
IN POORLY DRAINED LOW LYING AREAS. THE COMBINATION OF SNOW...SLICK
ROADS AND DENSE FOG WILL MAKE TRAVEL LOCALLY HAZARDOUS IN THE
MOUNTAINS.

ALL INTERESTS SHOULD KEEP INFORMED AND LISTEN FOR LATER FORECASTS
AND POSSIBLE ADVISORIES. PEOPLE SHOULD BE PREPARED TO TAKE QUICK
ACTION IN CASE FLOODING DEVELOPS.

$$

JAD/LAVIS
Issuing Weather Forecast Office Homepage
Short Term Forecast - Riverside County Mountains (California)

Updated: Sat, 08-Dec-2007 12:03pm PST

ISOLATED SHOWERS WITH SNOW ABOVE 4000 FT WILL CONTINUE THROUGH 6
PM. THE SHOWERS WILL MOVE FROM WEST TO EAST AT ABOUT 20 MPH.
RAINFALL TOTALS WILL BE UP TO 0.15 INCHES PER HOUR...WITH THE
HEAVIEST SHOWERS IN SAN DIEGO COUNTY. LOCAL SNOWFALL RATES OF HALF
AN INCH PER HOUR ARE POSSIBLE. IN ADDITION TO THE SLICK ROADS...
AREAS OF DENSE FOG WILL REDUCE VISIBILITY TO LESS THAN 1/4 MILE AND
WILL MAKE TRAVEL DIFFICULT AT TIMES.

$$

SMALL
Issuing Weather Forecast Office Homepage
Snow Advisory - Riverside County Mountains (California)

Updated: Sat, 08-Dec-2007 12:03pm PST


.LOW PRESSURE TRACKING JUST OFF THE COAST WILL LOWER THE SNOW LEVEL
TO AROUND 3000 FEET OVERNIGHT AND EARLY SUNDAY. PRECIPITATION IN
UPSLOPE FLOW WILL BRING A PERIOD OF MODERATE SNOW WITH ACCUMULATIONS
OF FOUR TO LOCALLY EIGHT INCHES ABOVE 4000 FEET BY NOON SUNDAY.
HEAVIEST SNOWFALL IS EXPECTED IN THE RIVERSIDE AND SAN DIEGO
COUNTY MOUNTAINS ON SUNDAY MORNING.

CAZ056-058-090600-
/O.NEW.KSGX.SN.Y.0004.071209T0000Z-071209T2000Z/
RIVERSIDE COUNTY MOUNTAINS-SAN DIEGO COUNTY MOUNTAINS-
140 PM PST SAT DEC 8 2007

...SNOW ADVISORY IN EFFECT FROM 4 PM THIS AFTERNOON TO 12 PM PST
SUNDAY...

THE NATIONAL WEATHER SERVICE IN SAN DIEGO HAS ISSUED A SNOW
ADVISORY...WHICH IS IN EFFECT FROM 4 PM THIS AFTERNOON TO 12 PM
PST SUNDAY.

SNOW IS EXPECTED TO INCREASE OVERNIGHT. AN ADDITIONAL 4 TO 8 INCHES
OF SNOW IS POSSIBLE BY NOON SUNDAY.

A SNOW ADVISORY MEANS THAT PERIODS OF SNOW WILL CAUSE PRIMARILY
TRAVEL DIFFICULTIES. BE PREPARED FOR SNOW COVERED ROADS AND
LIMITED VISIBILITIES...AND USE CAUTION WHILE DRIVING.

$$
Issuing Weather Forecast Office Homepage

See if this does what you want (the $ourTZ is set to PST8PDT and the $timeFormat is set to US-formatted date/time).

If this works for you, I'll update the main script with this mod.

Best regards,
Ken

Edit for released version of script.
« Last Edit: December 09, 2007, 01:04:57 AM 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 PSJohn

  • Senior Contributor
  • ****
  • Posts: 157
    • DesertWeather.com
Re: Time Zone Change in RSS Advisory script
« Reply #4 on: December 08, 2007, 10:50:37 PM »
Ken, the time stamp works great but what am I over looking? I am receiving this:
Notice: Undefined variable: PHP_SELF in /home/jslama33/public_html/rss-advisory056.php on line 137

UPDATE: I got it working. Thanks alot for your time and effort, I owe you one!
« Last Edit: December 08, 2007, 11:06:13 PM by PSJohn »
John Slama
Palm Springs, California
Davis Vantage Pro 2, FARS

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Time Zone Change in RSS Advisory script
« Reply #5 on: December 09, 2007, 12:19:11 AM »
You're welcome, John.

Try the script again from the URL.. I added one line
Code: [Select]
if (! isset($PHP_SELF) ) {$PHP_SELF = $_SERVER['PHP_SELF']; }
for those installations that don't seem to set the old built-in $PHP_SELF variable.

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 PSJohn

  • Senior Contributor
  • ****
  • Posts: 157
    • DesertWeather.com
Re: Time Zone Change in RSS Advisory script
« Reply #6 on: December 09, 2007, 12:50:31 AM »
Made change, works great, thanks
John Slama
Palm Springs, California
Davis Vantage Pro 2, FARS

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9257
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Time Zone Change in RSS Advisory script
« Reply #7 on: December 09, 2007, 01:04:17 AM »
You're welcome!!

I've done the release of the script for general use

http://saratoga-weather.org/scripts-rss.php#advisory

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

 

anything