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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i convert month name to a number?

Status
Not open for further replies.

pushyr

Programmer
Jul 2, 2007
159
GB
i googled this but cant find the answer and i'm guessing it's so simple....

this is my date format... 2007-Nov-13

and i would like to insert it into DATE in mysql, to do this i must convert the abbreviated month name into it's numeric equivalent

i have the choice of either doing this as the full string 2007-Nov-13, or just the month itself...as year, month and date are in an array... [1] [2] [3]
 
Code:
function mysqldate($date){
 return date("Y-m-d", strtotime($date));
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top