Comma in MySQL date output

Struggling with PHP or HTML? Got any tips? Drop in here to share your questions and answers. Newbies and gurus welcome!

Comma in MySQL date output

Postby sohel2009 » September 19th, 2009, 4:15 am

I am using a cold fusion cfquery to get data from my vB database.
One of the fields I am trying to get is a date field, and as you know they're unix datetimes.

I am using this and it works great:
<cfquery name="emaillist" datasource="#DSNMySQL#">
date_format(from_unixtime(vB36_user.joindate),'%M %d %Y') as joindate

The output looks like this: January 1 2003.
What I want is January 1, 2003.

How can I get the comma? If I use '%M %d, %Y', it puts the year into a new column.
I could format it the cold fusion page, but that's not how I'm using it, I build a script to download a csv of the data.
User avatar
Rank 0
Rank 0
Posts: 1
Joined: September 19th, 2009, 4:09 am

Return to PHP & HTML Questions

Who is online

Users browsing this forum: No registered users and 1 guest