How to get individual part of a date

Another way is to use the date / strtotime functions.

$str = "2003-12-31";
print(date("m",strtotime($str)));

Also, I believe there is a Year() Month() Day() functions within SQL that would return back those individual values as seperate fields.
 
Back
Top