Skip to content

Instantly share code, notes, and snippets.

@1stevengrant
Created October 28, 2012 17:21
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save 1stevengrant/3969207 to your computer and use it in GitHub Desktop.
Save 1stevengrant/3969207 to your computer and use it in GitHub Desktop.
Fixes the daylight savings issue with EE
var $dateTime = new DateTime();
$dateTime->setTimezone(new DateTimeZone('America/New_york'));
$dateTime->setTimestamp(time());
$isDst = (bool)$dateTime->format('I') ? "y" : "n";
$conf['daylight_savings'] = $isDst;
@jayeshjain24
Copy link

My website is having a countdown from 23july to current time.I am from india and my timing lag 5.30 hours.The problem is the site is also for pakistan,srilanka,bangladesh.So i need to have respective timezone using php.Any idea?Currently the countdown get deprecated by one day at 5.30 in morning instead of midnight

http://www.tensports.com/event/other/commonwealth-games-2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment