Some functions on this portal require JavaScript but your browser does not support it or it has been disabled.
Skip to main content
Saturday 11 March 2006 5:02:54 am - 6 replies
Betsy Gamrat
Saturday 11 March 2006 2:22:54 pm
Use the currentdate and datetime functions.
<b>currentdate()</b> will give you the current date, and <b>datetime</b> can be used to convert the timestamp into formats much like PHP.
For example:
{currentdate()|datetime('custom','%U')}
Be aware of timezones and date math (seconds, minutes, days, etc).
risto CMS user
Monday 13 March 2006 3:05:45 am
well this dosent print out the number of days. how dos one doo this?how can I convert day.month.year (in numbers) to same format as datetime?
Monday 13 March 2006 3:48:32 am
I need something like {mktime(0, 0, 0, 04, 09, 2006)}
Paul Borgermans
Monday 13 March 2006 4:19:08 am
See
http://ez.no/doc/ez_publish/technical_manual/3_6/reference/template_operators/miscellaneous
eZ Publish, eZ Find, Solr expert consulting and training http://twitter.com/paulborgermans
Tuesday 14 March 2006 3:12:58 am
This is what I ended up with:Its all good. ;-)
{let year=currentdate()|datetime('custom','%Y') month=currentdate()|datetime('custom','%m') day=currentdate()|datetime('custom','%d') } {maketime( 00 ,01 ,00 ,04 , 09, 2006)|datetime('custom','%U')|sub(maketime( 00 ,01 ,00 ,$month , $day ,$year)|datetime('custom','%U'))|div(60)|div(60)|div(24)|round}
Tuesday 14 March 2006 6:31:07 am
Good job!
... and thanks for posting your code.
You must be logged in to post messages in this topic!