Silicon Ghost wrote:
>
> I have a date column that inserts the date in the standard mySQL format of
> yyyy-mm-dd. This if fine with me, but when I READ the date, I want it to be
> shown as mm/dd/yyyy or mm-dd-yyyy.
>
> This can't be that hard, but I don't see anything in the manual that clearly
> describes how to do this.
>
> For example:
>
> I get this:
> mysql> select date from news where ID=1;
> +------------+
> | date |
> +------------+
> | 1999-08-03 |
> +------------+
> 1 row in set (0.00 sec)
>
> When I would prefer this:
> +------------+
> | date |
> +------------+
> | 03-08-1999 |
> +------------+
>
> Thanks,
>
> - John
Hi John
Just use:
SELECT DATE_FORMAT( date, '%m-%d-%Y') FROM news WHERE ID = 1;
Tschau
Christian