Forums / Developer / format number

format number

Author Message

Mike Makris

Friday 08 October 2010 8:10:33 am

How do I format a number so that it has a leading zero if single digit - to be used as the day number in a date dropdown?

MikeM

Marko Žmak

Friday 08 October 2010 3:06:30 pm

Look at the datetime function:

http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Template-operators/Formatting-and-internationalization/datetime

What you probably need is:

{$date|datetime(custom, '%d')}

where the $datetime should be the timestamp of the date you want to display.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth