...

View Full Version : Convert Dec-03-03 to 12/3/2003 ?



jhilb
12-09-2003, 01:44 AM
I am trying to figure out how to convert the following date format:

Dec-03-03 (MMM-DD-YY)

into

12/03/2003



Any native php functions to do this? I couldn't find anything.

Php only, not MySQL.

Thanks,
J

stuntboy
12-09-2003, 05:38 AM
Ok you will have to slightly change the form of your date but there is a function that can do it.

strtotime() can convert english dates into a timestamp then from there you can use date() to format it to your choice.

echo date ("m/d/Y",strtotime ("Dec 03 03"));

(notice the removal of the -

but if you are stuck with that format you can always remove the dash before processing

jhilb
12-10-2003, 03:39 AM
thanks very much, I'll try that

jhilb
12-10-2003, 04:07 AM
You rock! thanks. WOrked great.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum