List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:August 4 1999 7:45pm
Subject:Re: How do I READ date as mm/dd/yyyy?
View as plain text  
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

Thread
How do I READ date as mm/dd/yyyy?Silicon Ghost4 Aug
  • RE: How do I READ date as mm/dd/yyyy?Bryan Porter4 Aug
  • Re: How do I READ date as mm/dd/yyyy?Christian Mack4 Aug
RE: How do I READ date as mm/dd/yyyy?adhir4 Aug