summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorIban Eguia <admin@razican.com>2012-06-12 16:09:36 +0200
committerIban Eguia <admin@razican.com>2012-06-12 16:09:36 +0200
commitfeb14dac4e7a417a48344a5188a8ad8074871df4 (patch)
treeecbd2962417cdb7b38c0332908acb96784870891 /system/libraries
parentc88daba688d309150a7dce43817ab76ec7834bda (diff)
Changed the config parameter. The session's _get_time() function has also changed.
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Session.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/system/libraries/Session.php b/system/libraries/Session.php
index 7beedd96b..9fdf744c3 100644
--- a/system/libraries/Session.php
+++ b/system/libraries/Session.php
@@ -786,9 +786,17 @@ class CI_Session {
*/
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);
}
// --------------------------------------------------------------------