Possible Duplicate:
convert month from name to number
I have a simple (yet interesting) query for all.
I am getting month name, in short, like Jan, Feb, etc. Now I need to convert it to month-number ( i.e., Numeric representation of a month), with leading zeros
Example: “Jan” to “01”, “Dec” to “12”, etc
Anyone know, how to achieve this, without using array
Thanks
strtotimeconverts “Feb” to the timestamp for February 6th 2011 15:15:00 (at the time of writing), taking what it can from the given string and filling in the blanks from the current time.date('m')then formats this timestamp, outputting only the month number.Since this may actually cause problems on, say, the 31st, you should fill in these blanks to be sure: