date_default_timezone_set($city['timezone_id']); return true; } } } date_default_timezone_set($defaultimeZone); return false; } $conf =& JFactory::getConfig(); //set_tz_by_offset($conf->getValue('config.offset')); global $DT_config, $month_arr, $now, $xhtml_url, $amp, $sign_up_redirect; jimport('joomla.application.module.helper'); jimport('joomla.utilities.date'); $now = new JDate('now'); //$now = new JDate(strftime('%Y-%m-%d %H:%M:%S')); $now->setoffset($conf->getValue('config.offset')); //pr(strftime('%Y-%m-%d %H:%M:%S %Z%n')); //date_default_timezone_set($defaultimeZone); //$now->setOffset($conf->getValue('config.offset')); $month_arr = array('01' => JText::_('DT_JAN'), '02' => JText::_('DT_FEB'), '03' => JText::_('DT_MAR'), '04' => JText::_('DT_APR'), '05' => JText::_('DT_MAY'), '06' => JText::_('DT_JUN'), '07' => JText::_('DT_JUL'), '08' => JText::_('DT_AUG'), '09' => JText::_('DT_SEP'), '10' => JText::_('DT_OCT'), '11' => JText::_('DT_NOV'), '12' => JText::_('DT_DEC')); $xhtml_url = false; if ($xhtml_url) { $amp = "&"; } else { $amp = "&"; } if (!function_exists('pr')) { function pr($data = array()) { //return; /*
function shiftDates(&$data) { $this->dtstart; $startdate = new JDate($this->parent_dtstart); $newstartdate = new JDate($data['dtstart']); $startdate_offset = $newstartdate->toUnix() - $startdate->toUnix(); $arrDates = array('startdate', 'cut_off_date', 'bird_discount_date', 'latefeedate', 'change_date', 'cancel_date', 'dtend'); foreach ($arrDates as $name) { if (isset($data[$name]) && $data[$name] != "" && $data[$name] != "0000-00-00") { $diff_offset = (strtotime($data[$name]) - $startdate->toUnix(false) + $startdate_offset) / 3600; $startdate->setoffset($diff_offset); $data[$name] = $startdate->toFormat('%Y-%m-%d'); } else { $data[$name] = ""; } } }