| General Plugin info | |
|---|---|
| Author: | Nate Silva |
| Current Version: | 1.0 |
| Download: | Download the plugin (zip) |
| Code: | NP_BetterDate_Code |
| Demo: | - |
| Forum Thread: | - |
This plugin is an improved date function. The date() function in Nucleus is based on strftime(). This improved function is based on PHP's date() and gmdate(). It allows additional formatting options and better control over timezone presentation.
This plugin will allow you to use all the date format specifiers that the PHP date() function allows. In addition two special formats are provided (iso8601 and tzwithcolon).
<%BetterDate(datetype, format)%>
Where datetype is one of: posted, postedutc, now or nowutc. This returns either the timestamp of the current post, or the current date; in either local or UTC time.
format is a date format string. The syntax is exactly the same as PHP's date() function (here is a reference for format codes).
In addition, format may be one of the special values: iso8601 which will use the international standard format; or tzwithcolon, used in the issued tag of an Atom 0.3 feed (so your feed can validate with feeds.archive.org).
<!-- call this from a nucleus template --> <%BetterDate(postedutc,iso8601)%> <%BetterDate(posted,B)%> <!-- Swatch Internet time --> <%BetterDate(posted,l \t\h\e jS)%> <!-- something like 'Saturday the 8th' --> <%BetterDate(now,iso8601)%> <%BetterDate(nowutc,iso8601)%> <%BetterDate(posted,tzwithcolon)%> <!-- for 'issued' tag of Atom feed to validate -->
NP_BetterDate version 1.0 works with Nucleus CMS version 3.31 - 2007-10-30 kg