Author Topic: Sunrise Sunset Times Wrong in wxastronomy.php  (Read 398 times)

0 Members and 1 Guest are viewing this topic.

Offline Andy G

  • Forecaster
  • *****
  • Posts: 306
    • SunPrairieWeather.com
Sunrise Sunset Times Wrong in wxastronomy.php
« on: January 20, 2022, 08:46:32 AM »
Hello

After a few year break (not in prison 8-)) from my website http://www.sunprairieweather.com/index.php I have decided to revive it. I am mostly starting from scratch as the old one turned into a bit of a mess, with many broken pages ect. So I plan to have a little less this time. Easier to maintain and keep things working and have the base template working correctly before customizing. My first problem is on my wxastronomy.php page http://www.sunprairieweather.com/wxastronomy.php the times are not correct. Looking for some help before I move on.

Thank You Andy
Once you can accept the universe as being something expanding into an infinite nothing which is something, wearing stripes with plaid is easy.
~Einstein


SunPrairieWeather.com
Davis VP2 24 FARS

Offline Daali

  • weather n00b
  • Senior Contributor
  • ****
  • Posts: 223
    • The weather in Jefferson, GA
Re: Sunrise Sunset Times Wrong in wxastronomy.php
« Reply #1 on: January 20, 2022, 09:21:21 AM »
looking at the code, someone with more knowledge will need to see some of your settings.php and possibly common.php to figure out what is happening.

not your site code, but the version I found in git
Code: [Select]
NOTE: you don't have to change these defaults.. use Settings.php to set your values.
$timeFormat = 'd-M-Y g:ia';  // 31-Mar-2006 6:35pm
//$timeFormat = 'd-M-Y H:i';   // 31-Mar-2006 18:35
$timeOnlyFormat = 'g:ia';    // h:mm[am|pm];
//$timeOnlyFormat = 'H:i';     // hh:mm
$dateOnlyFormat = 'd-M-Y';   // d-Mon-YYYY
$WDdateMDY = true;     // true=dates by WD are 'month/day/year'
//                     // false=dates by WD are 'day/month/year'
$ourTZ = "PST8PDT";  //NOTE: this *MUST* be set correctly to
// translate UTC times to your LOCAL time for the displays.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Sunrise Sunset Times Wrong in wxastronomy.php
« Reply #2 on: January 20, 2022, 12:34:21 PM »
Looking at your testtags.php?sce=view shows
Code: [Select]
$stationlatitude =  '   :  :  ';    // Latitude (from the sun moon rise/set setup)
$stationlongitude =  '    :  :  ';    // Longtitude (from the sun moon rise/set setup)
which shows you've not entered your latitude and longitude into WD so it thinks you're at 0,0 .

Use Weather-Display, Control Panel, Sun/Lunar Coordinates TAB

Enter your latitude and longitude there.  NOTE:  don't use a - (minus) sign for Longitude.  The Longitude is astronomical (+ = WEST of GMT), not terrestrial (- = WEST of GMT).

For example, my station here in Saratoga, CA, USA has
Code: [Select]
$stationlatitude =  '037:16:28'; // Latitude (from the sun moon rise/set setup)
$stationlongitude =  '0122:01:23'; // Longtitude (from the sun moon rise/set setup)
  (notice the 122 is NOT -122.

Then WD should correctly compute sun/moon rise/set info for you.
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 Andy G

  • Forecaster
  • *****
  • Posts: 306
    • SunPrairieWeather.com
Re: Sunrise Sunset Times Wrong in wxastronomy.php
« Reply #3 on: January 20, 2022, 01:17:46 PM »
Thank you so much ken. I see you are still the backbone of this whole operation. Tried to get alyajaxboard6 working had two errors, will try to find an answer before posting. Thanks again.

Andy
Once you can accept the universe as being something expanding into an infinite nothing which is something, wearing stripes with plaid is easy.
~Einstein


SunPrairieWeather.com
Davis VP2 24 FARS

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Sunrise Sunset Times Wrong in wxastronomy.php
« Reply #4 on: January 20, 2022, 03:31:21 PM »
I'll be working through the alt-dashboard issues with PHP 8.1 soon.. going through the basic template scripts first.
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