summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-16 18:11:40 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-16 18:11:40 +0200
commitb089e15b1510de6b6a034631c80d3d5e830ff9f3 (patch)
tree5202519894737668faacee99c386a2453c7bce68
parent1764dd7d4ab6e6e5c799eaa9ce007fce48fa0b63 (diff)
Fix local_to_gmt()
-rw-r--r--system/helpers/date_helper.php14
-rw-r--r--tests/codeigniter/helpers/date_helper_test.php6
2 files changed, 10 insertions, 10 deletions
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php
index 065a223ef..cafb6ba95 100644
--- a/system/helpers/date_helper.php
+++ b/system/helpers/date_helper.php
@@ -304,13 +304,13 @@ if ( ! function_exists('local_to_gmt'))
$time = time();
}
- return gmmktime(
- date('G', $time),
- date('i', $time),
- date('s', $time),
- date('n', $time),
- date('j', $time),
- date('Y', $time)
+ return mktime(
+ gmdate('G', $time),
+ gmdate('i', $time),
+ gmdate('s', $time),
+ gmdate('n', $time),
+ gmdate('j', $time),
+ gmdate('Y', $time)
);
}
}
diff --git a/tests/codeigniter/helpers/date_helper_test.php b/tests/codeigniter/helpers/date_helper_test.php
index 1d397ac81..8258c9248 100644
--- a/tests/codeigniter/helpers/date_helper_test.php
+++ b/tests/codeigniter/helpers/date_helper_test.php
@@ -196,9 +196,9 @@ class Date_helper_test extends CI_TestCase {
public function test_local_to_gmt()
{
$this->assertEquals(
- gmmktime(
- date('G', $this->time), date('i', $this->time), date('s', $this->time),
- date('n', $this->time), date('j', $this->time), date('Y', $this->time)
+ mktime(
+ gmdate('G', $this->time), gmdate('i', $this->time), gmdate('s', $this->time),
+ gmdate('n', $this->time), gmdate('j', $this->time), gmdate('Y', $this->time)
),
local_to_gmt($this->time)
);