global $CFG, $USER;
+ // Work out the best timezone to use, in order of precedence
+ $timezones = array(
+ 99, // this is a placeholder that gets skipped in the first next() call
+ isset($USER->timezone) ? $USER->timezone : 99,
+ isset($CFG->timezone) ? $CFG->timezone : 99,
+ );
+ while($timezone == 99 && $next = next($timezones)) {
+ $timezone = (float)$next;
+ }
+
+ /*
if ($timezone == 99) {
if (isset($USER->timezone)) { // A user is logged in
$timezone = (float)$USER->timezone;
$timezone = (float)$CFG->timezone;
}
}
+ */
if (abs($timezone) > 13) {
return mktime((int)$hour,(int)$minute,(int)$second,(int)$month,(int)$day,(int)$year);
$fixday = ($formatnoday != $format);
}
+ // Work out the best timezone to use, in order of precedence
+ $timezones = array(
+ 99, // this is a placeholder that gets skipped in the first next() call
+ isset($USER->timezone) ? $USER->timezone : 99,
+ isset($CFG->timezone) ? $CFG->timezone : 99,
+ );
+ while($timezone == 99 && $next = next($timezones)) {
+ $timezone = (float)$next;
+ }
+
+ /*
if ($timezone == 99) { // Work out the best timezone to use
if (isset($USER->timezone)) { // A user is logged in
$timezone = (float)$USER->timezone;
$timezone = (float)$CFG->timezone;
}
}
+ */
if (abs($timezone) > 13) {
if ($fixday) {
global $USER, $CFG;
+
if ($timezone == 99) { // Work out the best timezone to use
if (isset($USER->timezone)) { // A user is logged in
$timezone = (float)$USER->timezone;
/// the timezone. eg 3pm in India is 3pm GMT - 7 * 3600 seconds
global $USER, $CFG;
+ // Work out the best timezone to use, in order of precedence
+ $timezones = array(
+ 99, // this is a placeholder that gets skipped in the first next() call
+ isset($USER->timezone) ? $USER->timezone : 99,
+ isset($CFG->timezone) ? $CFG->timezone : 99,
+ );
+ while($timezone == 99 && $next = next($timezones)) {
+ $timezone = (float)$next;
+ }
+
+ /*
if ($timezone == 99) { // Work out the best timezone to use
if (isset($USER->timezone)) { // A user is logged in
$timezone = (float)$USER->timezone;
$timezone = (float)$CFG->timezone;
}
}
+ */
if (abs($timezone) > 13) {
return $date;
}
/// for the current user.
global $USER, $CFG;
+ // Work out the best timezone to use, in order of precedence
+ $timezones = array(
+ 99, // this is a placeholder that gets skipped in the first next() call
+ isset($USER->timezone) ? $USER->timezone : 99,
+ isset($CFG->timezone) ? $CFG->timezone : 99,
+ );
+ while($timezone == 99 && $next = next($timezones)) {
+ $timezone = (float)$next;
+ }
+ /*
if ($timezone == 99) { // Work out the best timezone to use
if (isset($USER->timezone)) { // A user is logged in
$timezone = (float)$USER->timezone;
$timezone = (float)$CFG->timezone;
}
}
-
+ */
$userdate = usergetdate($date, $timezone);
if (abs($timezone) > 13) {
/// Returns a string that prints the user's timezone
global $USER, $CFG;
+ // Work out the best timezone to use, in order of precedence
+ $timezones = array(
+ 99, // this is a placeholder that gets skipped in the first next() call
+ isset($USER->timezone) ? $USER->timezone : 99,
+ isset($CFG->timezone) ? $CFG->timezone : 99,
+ );
+ while($timezone == 99 && $next = next($timezones)) {
+ $timezone = (float)$next;
+ }
+ /*
if ($timezone == 99) { // Work out the best timezone to use
if (isset($USER->timezone)) { // A user is logged in
$timezone = (float)$USER->timezone;
$timezone = (float)$CFG->timezone;
}
}
+ */
if (abs($timezone) > 13) {
return "server time";
}