Changed the config parameter. The session's _get_time() function has also changed.
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php
index b818da9..131508f 100644
--- a/system/helpers/date_helper.php
+++ b/system/helpers/date_helper.php
@@ -52,7 +52,7 @@
{
if (empty($timezone))
{
- $timezone = config_item('timezone');
+ $timezone = config_item('time_reference');
}
if ($timezone === 'local' OR $timezone === date_default_timezone_get())
diff --git a/system/libraries/Session.php b/system/libraries/Session.php
index 7beedd9..9fdf744 100644
--- a/system/libraries/Session.php
+++ b/system/libraries/Session.php
@@ -786,9 +786,17 @@
*/
protected function _get_time()
{
- return (strtolower($this->time_reference) === 'gmt')
- ? mktime(gmdate('H'), gmdate('i'), gmdate('s'), gmdate('m'), gmdate('d'), gmdate('Y'))
- : time();
+ $timezone = config_item('time_reference');
+
+ if ($timezone === 'local' OR $timezone === date_default_timezone_get())
+ {
+ return time();
+ }
+
+ $datetime = new DateTime('now', new DateTimeZone($timezone));
+ sscanf($datetime->format('j-n-Y G:i:s'), '%d-%d-%d %d:%d:%d', $day, $month, $year, $hour, $minute, $second);
+
+ return mktime($hour, $minute, $second, $month, $day, $year);
}
// --------------------------------------------------------------------