I'm trying to take the date stored in MySql database and then turn it into individual parts of a date. For example, I want one variable to just hold the month (ex: $sMonth = 'Feb'). However when I try to retrieve the month from the Start Date (2003-02-02 05:33:00), it gives me incorrect data.
What am I doing wrong?
$row['StartDate]; *This is the StartDate that is retrieved from my database:
2003-02-02 05:33:00
I've tried this but it doesn't work:
$date_array = explode("-", $row['StartDate']);
echo "Month=" . $date_array[0];
I've tried this and it gives me "Dec" instead of "Feb"
$sMonth = date("M", $sStartDate);
Thanks for your help!!
Andrea