I thought the best way to do this would be to use a combination of mktime and date, and this works for adding an hour if daylight savings time is in effect.
$hour = $dst ? $sunset_a[hour]+1 : $sunset_a[hour]; $time = mktime ($hour,$minute,0,1,1,2003); $time = date("G:i", $time);
But how do I do this for minutes? If I do this: $minute = $sunset_a[minute]-40;
and plug that into the mktime line above, I get the wrong answer: 24:00 - 40, not $sunset_a[minute] - 40.
Is there no easy way to subtract time n PHP, like in MySQL with DATE_SUB? Or am I missing something easy with mktime?
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php