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:48:32 am
I need something like {mktime(0, 0, 0, 04, 09, 2006)}
|
risto CMS user
|
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}
|