Current version: (2005-12-22)
This macro allows to parse a date/time string and to reformat it in a custom format.
I create this macro because I needed of showing the publication date of RSS article which are in format like this
11 Dec 2005 14:44:24 GMT
but I needed of formatting it in dd/mm/aaaa hh:mm format. I solved problem with this macro
^DateParse("%d %b %Y %T %Z","%d/%m/%y %R",<tmpl_var pubDate>");
As you see, you could use three parameters for this macro
All these parameters are optionals and default values are
So using it as ^DateParse(); return current time in your profile format.
The syntax of the format and parser strings can be found here.
This macro has been tested in 6.7.8 but should be worked also in 6.8.x.
You can see an working example here.
To install it copy DateParse.pm into lib/WebGUI/Macro. Then open WebGUI.conf and append
DateParse=> DateParse
at the end of the macro section. If, as an example, last line is
u => u_companyUrl
replace this with
u => u_companyUrl, \
DateParse => DateParse