summaryrefslogtreecommitdiffstats
path: root/system/helpers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2016-12-01 13:14:18 +0100
committerAndrey Andreev <narf@devilix.net>2016-12-01 13:14:18 +0100
commit9e829e10e6f2d3786c358ca6c8c3ba2a149a6a40 (patch)
treec38faf49e7274c3edfdb5ebb59ce80ac35fe57d8 /system/helpers
parentefd856edce0b952c8a7a62ec953ae1baee77ff34 (diff)
parent8db01f13809a92bac7bc95b02893175d7654d627 (diff)
Merge branch '3.1-stable' into develop
Diffstat (limited to 'system/helpers')
-rw-r--r--system/helpers/date_helper.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php
index 5f1fcf07e..0606a4562 100644
--- a/system/helpers/date_helper.php
+++ b/system/helpers/date_helper.php
@@ -496,6 +496,7 @@ if ( ! function_exists('nice_date'))
* Turns many "reasonably-date-like" strings into something
* that is actually useful. This only works for dates after unix epoch.
*
+ * @deprecated 3.1.3 Use DateTime::createFromFormat($input_format, $input)->format($output_format);
* @param string The terribly formatted date-like string
* @param string Date format to return (same as php date function)
* @return string
@@ -529,9 +530,9 @@ if ( ! function_exists('nice_date'))
}
// Date Like: YYYYMMDD
- if (preg_match('/^(\d{2})\d{2}(\d{4})$/i', $bad_date, $matches))
+ if (preg_match('/^\d{8}$/i', $bad_date, $matches))
{
- return date($format, strtotime($matches[1].'/01/'.$matches[2]));
+ return DateTime::createFromFormat('Ymd', $bad_date)->format($format);
}
// Date Like: MM-DD-YYYY __or__ M-D-YYYY (or anything in between)