Hi all,
how do i convert lets say 'Jan', 'Dec', 'Sep' into a integer value '1','12','9'?
The month is in the database as a 3 letter character.
[SOLVED] convert a month into integer
Moderator: General Moderators
simple swith statement
Code: Select all
switch($month)
{
case "jan":
$mon = 1;
break;
case "feb":
$mon = 2;
break;
// etc.....
}
echo $mon;Code: Select all
SELECT DATE_FORMAT('Jan','%d');