Re: date format help request



Hi Moose,


You can use the date() and strtotime() function to convert your
result;

You can try like this:
echo date( "m-d-Y", strtotime("2008-05-25") );


OUTPUT:
05-25-2008




Regards,

Fahad Khan


On May 25, 11:40 am, Moose <1...@xxxxxxxxxxx> wrote:
I have a .PhP web page that gets its results from a query like
$result = mysql_query("SELECT * FROM myTable Order by DueDate",$db);

The result includes a field with a date, which gets returned as
"2008-05-25".

What would be required to have the query return a date with the format
like "05.25.2008".

I have to figure this has to have a simple solution, but I don't know
whether to start with the MySQL database settings or by using PhP.

Thanks,

.



Relevant Pages

  • Re: [Date] Converting dd/mm/yyyy to YYYY-MM-DD?
    ... over here, so strtotime() is wrong. ... It does somewhat annoy me that PHP will assume 01/02/03 to be 2 Jan 2003, ... when the vast majority of the world's population will take it to be either ... Australia and NZ all use little-endian DMY dates: ...
    (comp.lang.php)
  • Re: parse dates
    ... I have been using PHP the last while and in particular strtotime. ... I have seen DateUtil, but it seems to be able to do ... Freedom is always the freedom of dissenters. ...
    (comp.lang.python)
  • Re: i love strtotime but it is no use in New Zealand
    ... windandwaves wrote: ... I love the strtotime function, because I can make a date field in a form ... PHP purposes, which is easy once you know what field is what. ... # Returns a timestamp from a string based on the given format and default ...
    (comp.lang.php)
  • Re: [PHP] Re: strtotime
    ... Cette liste est une liste anglaise, reformulent svp votre question en ... PHP General Mailing List ... Probably because strtotime returns null so date thinks that null is equivalent to 0 or something like that AFAIK. ...
    (php.general)
  • Re: [PHP] dst and strtotime
    ... Subject: [PHP] dst and strtotime ... www.dwsasia.com - company web site ...
    (php.general)