diff options
author | Derek Jones <derek.jones@ellislab.com> | 2011-08-25 14:24:06 +0200 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2011-08-25 14:24:06 +0200 |
commit | be72bd2d1cdba222bbbce547e1603de1e4ec7961 (patch) | |
tree | 850711b8f4e981fcd1bf51151b1d71d53f630076 /user_guide/helpers/date_helper.html | |
parent | 4bc4c1476344f96ebb920677f608cb185a48eaed (diff) | |
parent | 9ff6336415f3da2a81142cb23343060df6196ebe (diff) |
Merge branch 'develop' of github.com:EllisLab/CodeIgniter into develop
Diffstat (limited to 'user_guide/helpers/date_helper.html')
-rw-r--r-- | user_guide/helpers/date_helper.html | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/user_guide/helpers/date_helper.html b/user_guide/helpers/date_helper.html index f930ea3ae..5b00e25e0 100644 --- a/user_guide/helpers/date_helper.html +++ b/user_guide/helpers/date_helper.html @@ -234,6 +234,20 @@ $unix = human_to_unix($human);</code> +<h2>nice_date()</h2> + +<p>This function can take a number poorly-formed date formats and convert them into something useful. It also accepts well-formed dates.</p> +<p>The function 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:</p> + +<code>$bad_time = 199605<br /> +<br /> +// Should Produce: 1996-05-01<br /> +$better_time = nice_date($bad_time,'Y-m-d');<br /> +<br /> +$bad_time = 9-11-2001<br /> +// Should Produce: 2001-09-11<br /> +$better_time = nice_date($human,'Y-m-d');</code> + <h2>timespan()</h2> |