Advertisement
dprophit

CRE 6.4 timezone for mysql function found in application_top

May 21st, 2011
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. // Set the Time Zone
  2. if ( ! defined(STORE_TIME_ZONE)) define('STORE_TIME_ZONE', 'America/New_York');
  3. date_default_timezone_set(STORE_TIME_ZONE);
  4. $timezone = new DateTimeZone(STORE_TIME_ZONE);
  5. $dateTime = new DateTime("now", $timezone);
  6. $timeOffset = $timezone->getOffset($dateTime);
  7. if ($timeOffset != 0) {
  8.   $hours = floor($timeOffset / 3600);
  9.   $mins = abs($timeOffset) - abs($hours * 3600);
  10.   define('TEMP_TZ', '-3\:00');
  11.   tep_db_query("SET SESSION time_zone = '" . TEMP_TZ . "'");
  12.   unset($hours, $mins);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement