if(!empty(self::$timezones)) {
return self::$timezones;
}
-
- $ce = DB_DataObject::factory('core_enum');
+ $ce = DB_DataObject::factory('core_enum');
$ce->query("
SELECT
*, TIME_FORMAT(TIMEDIFF(NOW(), CONVERT_TZ(NOW(), Name, 'UTC')), '%H:%i') as timeOffset
AND
Name NOT LIKE '%/%/%'
AND
+ Name NOT LIKE 'right%'
+ AND
+ Name NOT LIKE 'posix%'
+ AND
Name NOT LIKE 'Etc%'
ORDER BY
- timeoffset DESC,
- Name DESC
+ SUBSTRING_INDEX(Name, '/', 1) ASC,
+ timeoffset ASC,
+ Name ASC
");
while($ce->fetch()) {
return '';
}
+ if($dt == '0000-00-00 00:00:00' || $dt == '') {
+ $dt = 'NOW';
+ }
+
$date = new DateTime($dt, new DateTimeZone($tz));
return $date->format('P');
}