summaryrefslogtreecommitdiffstats
path: root/system
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
parentc88daba688d309150a7dce43817ab76ec7834bda (diff)
Changed the config parameter. The session's _get_time() function has also changed.
Diffstat (limited to 'system')
-rw-r--r--system/helpers/date_helper.php2
-rw-r--r--system/libraries/Session.php14
2 files changed, 12 insertions, 4 deletions
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php
index b818da9d8..131508f69 100644
--- a/system/helpers/date_helper.php
+++ b/system/helpers/date_helper.php
@@ -52,7 +52,7 @@ if ( ! function_exists('now'))
{
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 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);
}
// --------------------------------------------------------------------