Some optimizations to the date helper
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php
index a5c46e4..d5036f6 100644
--- a/system/helpers/date_helper.php
+++ b/system/helpers/date_helper.php
@@ -314,13 +314,13 @@
$time = time();
}
- return mktime(
- gmdate('H', $time),
- gmdate('i', $time),
- gmdate('s', $time),
- gmdate('m', $time),
- gmdate('d', $time),
- gmdate('Y', $time)
+ return gmmktime(
+ date('H', $time),
+ date('i', $time),
+ date('s', $time),
+ date('m', $time),
+ date('d', $time),
+ date('Y', $time)
);
}
}
@@ -375,9 +375,7 @@
// since the formatting changed with MySQL 4.1
// YYYY-MM-DD HH:MM:SS
- $time = str_replace('-', '', $time);
- $time = str_replace(':', '', $time);
- $time = str_replace(' ', '', $time);
+ $time = str_replace(array('-', ':', ' '), '', $time);
// YYYYMMDDHHMMSS
return mktime(