Forums / Setup & design / Syntax help please, setting a var to current day
Arran Price
Tuesday 04 January 2005 4:47:27 pm
Hi, Im looking for what I believe should be a one liner, to set a var to be equal to the current day (number with leading 0's if required).I figure it should be something along the lines of:
{set chosen_day=currentdate|datetime( custom, '%d') }
But have tried various combinations of syntax of above with no luck.
Any help appreciated.
cheers
Arran
Michael D.
Wednesday 05 January 2005 2:53:29 am
chosen_day=currentdate()|datetime( custom, '%d') should work.(I just added a pair of round brackets after currentdate.)
If it still does not work, then the problem might lie elsewhere and you would have to be more specific about it.
Which eZ publish version do you use? In which context do you use these lines? Did you init "chosen_day" with let?How are you trying to use the var?
But that's just in case the round brackets won't do the trick.
Wednesday 05 January 2005 11:27:53 am
thanks, a couple of brackets did the trick.I could have sworn I tried that as well.
Oh well.
thanks again