Posted by Bosconian on 02/05/06 22:03
"Gordon Burditt" <gordonb.z8la0@burditt.org> wrote in message
news:11u8eefk2sda38b@corp.supernews.com...
> >I must be having a brain freeze because I can't figure out how to display
> >dates older than 1970.
> >
> >I have birth dates stored in MySQL as "date" data types (exp.
1955-04-06).
> >I'd like to display as "April 4, 1955".
>
> I recommend formatting it with MySQL's date_format() function.
>
> e.g.
>
> SELECT date_format(birthdate, "%M %e, %Y") from table where ...;
>
> MySQL's datetime format manages to cover years from 1 to 9999.
>
> Gordon L. Burditt
You're absolutely correct; this can be done in the query and is actually
faster that way.
However, when it's abolutely necessary in PHP the function posted in my
previous message works nicely.
[Back to original message]
|