Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Dates

Status
Not open for further replies.

Nightsoft

Programmer
Aug 23, 2001
50
DK
How do I chage a Date value from yyyy-mm-dd to dd-mm-yyyy?
I looked at a function called date_format but I don't seem to get the function...

The date must be formatted within the php code, and not in the SQL Query.

Anyone have some help on the date_format so that it'll work after my attention.?

thnx
Machine code Rocks:)
 
try this:


// $thedate is the date in format yyyy-mm-dd
// $newdate is reformated date to dd-mm-yyy

list ($year,$month,$day) = split("-",$thedate,3);
$newdate = "$day-$month-$year";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top