Skip to content

Instantly share code, notes, and snippets.

@rsanchez
Forked from 1stevengrant/config.php
Created December 17, 2012 18:06
Show Gist options
  • Save rsanchez/4320437 to your computer and use it in GitHub Desktop.
Save rsanchez/4320437 to your computer and use it in GitHub Desktop.
//for PHP 5.2
$dateTime = new DateTime();
$dateTime->setTimezone(new DateTimeZone('America/New_york'));
$date = getdate();
$dateTime->setDate($date['year'], $date['mon'], $date['mday']);
$dateTime->setTime($date['hours'], $date['minutes'], $date['seconds']);
$conf['daylight_savings'] = (bool) $dateTime->format('I') ? 'y' : 'n';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment