Commit 011c956b authored by Eloy Lafuente's avatar Eloy Lafuente
Browse files

Merge branch 'm20_MDL-14934_excel_time' of github.com:dongsheng/moodle

parents 81284044 869bbb30
......@@ -212,7 +212,13 @@ class MoodleExcelWorksheet {
$format = $this->MoodleExcelFormat2PearExcelFormat($format);
/// Convert the date to Excel format
$timezone = get_user_timezone_offset();
$value = ((usertime($date) + (int)($timezone * HOURSECS * 2)) / 86400) + 25569;
if ($timezone == 99) {
// system timezone offset in seconds
$offset = (int)date('Z');
} else {
$offset = (int)($timezone * HOURSECS * 2);
}
$value = ((usertime($date) + $offset) / 86400) + 25569;
/// Add the date safely to the PEAR Worksheet
$this->pear_excel_worksheet->writeNumber($row, $col, $value, $format);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment