Forums / Setup & design / Date format / Comment14909
James Packham
Wednesday 03 March 2004 2:18:19 am
|datetime( 'custom', '%d.%m.%Y') Converts a unix time date into something more meaningful - Unix dates count the number of seconds that have passed since 12:00am 1st Jan 1970, which doesn't really mean a lot to human eyes :) If you try to use this function to change any other date format into another date format it simply won't work - i.e. 03.23.2004 can not be changed into 23.03.2004 just by piping it with the function.
The good news is that all you need to do to make this work is to convert your date to unix time by working out the number of seconds in between 01.01.1970 and 03.23.2004, then piping it with datetime. It all sounds a bit complicated, but you can use it to your advantage because although the numbers are large the mathematics is very simple so you could, for example, make a count down to a certain date very easily.
Hope that helps,
Regards,
James
P.s. A way to simplify your problems might be to store your dates in unix time when you put them in the database.