Wednesday, December 13, 2006

MySQL to ColdFusion Date/DateTime Conversion

If you work with Coldfusion and MySQL database, and would like to retrieve and display data of date/datetime type, be sure to format it first with DateFormat() function.

For example: DateFormat(#date_vars#, "dd mmm yyyy") to make it like "23 Dec 2006".

Otherwise you would get output like this:
{ts 'the_date in yyyy-mm-dd hh:mm:ss'}

No comments: