From 37e5ff65b2bd1601daadac40fdfce80fd8956fd7 Mon Sep 17 00:00:00 2001 From: Kyle Farris Date: Sun, 21 Aug 2011 23:21:25 -0300 Subject: Added documentation for the nice_date function in the date_helper. --- user_guide/helpers/date_helper.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'user_guide/helpers') diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index f930ea3ae..29e242696 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -234,6 +234,20 @@ $unix = human_to_unix($human); +

nice_date()

+ +

This function can take a number poorly-formed date formats and convert them into something useful. It also accepts well-formed dates.

+

The fuction will return a Unix timestamp by default. You can, optionally, pass a format string (the same type as the PHP date function accepts) as the second parameter. Example:

+ +$bad_time = 199605
+
+// Should Produce: 1996-05-01
+$better_time = nice_date($bad_time,'Y-m-d');
+
+$bad_time = 9-11-2001
+// Should Produce: 2001-09-11
+$better_time = nice_date($human,'Y-m-d');
+

timespan()

-- cgit v1.2.3-24-g4f1b