Using Dates in PHP

Hi all,

I need some help with using dates in php. My page is getting the date caled ‘Due Date’ and printing it in a table. See php code:

echo “<tr><td>” . date(“M d Y”,strtotime($row[‘DueDate’])) . “</td>”;

I want to set variables to the month, date and year. Does anybody know how to do this? I’m new to php and so any help here is much needed and will be much appreciated!

Thank you!


$year = date('Y', $some_date);

Is that what you mean?

list($year,$month,$day)=explode("-",$row['DueDate']);

probably :slight_smile:

Worked like a charm…much easier than i thought!