Daylight hours script does not display longer than yesterday info

Blame it on astrophysics guys :lol: At this time of year the length of day is changing very slowly, for Raleigh NC my own script shows an increase of 45 seconds. I haven’t studied the posted script but at first glance it only has a one minute resolution so you are seeing the increase as 0 minutes.

If you want a more precise calculation try this:

<?php
$stationlat =  35.78;
$stationlong =  -78.64;
$z = 90.83333;
$tzz = 'America/New_York';
date_default_timezone_set($tzz);

//get the current offset from UTC
$WXTimeZone = new DateTimeZone($tzz);
$WXdateTime = new DateTime("now", $WXTimeZone);
$offset = ($WXTimeZone->getOffset($WXdateTime))/3600;

//get the timestamp for the start of today
$ddd = date('Ymd');
$ddn = date('l jS \of F Y'); //pretty date
$midnight = strtotime($ddd);

//get the timestamp for the start of yesterday
$lastmnight = strtotime($ddd)-86400;

//get timestamps for sunrise, sunset, and calculate length of day today
$tsrise = date_sunrise($midnight, SUNFUNCS_RET_TIMESTAMP, $stationlat, $stationlong, $z, $offset);
$tsset = date_sunset($midnight, SUNFUNCS_RET_TIMESTAMP, $stationlat, $stationlong, $z, $offset);
$tlod = $tsset - $tsrise;

//get timestamps for sunrise, sunset, and calculate length of day yesterday
$ysrise = date_sunrise($lastmnight, SUNFUNCS_RET_TIMESTAMP, $stationlat, $stationlong, $z, $offset);
$ysset = date_sunset($lastmnight, SUNFUNCS_RET_TIMESTAMP, $stationlat, $stationlong, $z, $offset);
$ylod = $ysset - $ysrise;

//output some stuff
print 'Today is: '.$ddn."
";
print 'Sunrise Today: '.date("H:i:s",$tsrise)."
";
print 'Sunset Today: '.date("H:i:s",$tsset)."
";
print 'Length of Day Today: '.gmdate("H:i:s", $tlod)."<hr br/>";
print 'Sunrise Yesterday: '.date("H:i:s",$ysrise)."
";
print 'Sunset Yesterday: '.date("H:i:s",$ysset)."
";
print 'Length of Day Yesterday: '.gmdate("H:i:s", $ylod)."<hr br/>";
$tdiff = abs($ylod-$tlod);
//print $tdiff;
$dchange=intval(gmdate('i', $tdiff))." minute(s) ".intval(gmdate('s',$tdiff))." second(s)";
if ( $tlod > $ylod ) {
$diffdesc = 'Increased By ';
} else {
$diffdesc = 'Decreased By ';
}		
print 'Day Length '.$diffdesc.$dchange."<hr br/>";
?>