Good evening, I installed my Davis Vantage Pro and meteobridge with this fantastic template. I managed to configure everything simply by following the procedures recommended by users, but the only thing I can’t fix is the sun block time with sunrise and sunset. I wanted to know if there is an additional change I could make to the scripts to fix the problem. I leave you a screenshot of the page with the red arrow on the block to be fixed. The link to my page is this
Thanks and congratulations.
Hi luciano_giannobile,
I did not find a solution yet.
The demo sites and my testsites display correct values.
Compared scripts involved, sun_c_block, moon_c_block and azimuth.php.
Think it is a timezone problem, similar to one you had in the past?
You added an extra line
$check = date_default_timezone_set('Europe/Rome');
in some of your blocks. The one in the moon blocks rests the time.
But the time is distorted in the sun block just before the block heading is printed.
I think that a system-wide 'static" variable is changed somehow.
$TZ from the settings is used in the sun and moon scripts.
Could you add a line between current line 167 and 168 in sun_c_block.php?
It should look like
$azimuth=$elevation=0;
$TZ = 'Europe/Rome';
get_azimuth ();
#
Lets see if that helps, if not, second test
$azimuth=$elevation=0;
get_azimuth ();
$TZ = 'Europe/Rome';
#
Wim
1 Like
Perfect I added a line as described,
$azimuth=$elevation=0;
$TZ = ‘Europe/Rome’;
get_azimuth ();
Now it works correctly, thanks for the valuable advice.
1 Like