Automatically adjust for daylight saving time
I have been googling for this and again come up with my own solution.
function my_set_gmt_offset($offset) {
$timezone = date("T");
if($timezone == 'EDT') {
$offset = '-4';
}
else if($timezone == 'EST') {
$offset = '-5';
}
return $offset;
}
if(function_exists('add_filter')) {
add_filter('option_gmt_offset', 'my_set_gmt_offset');
}
Share your feedback via comments.
March 4th, 2009 at 4:20 am
This would be a good idea. Quite useful too.