Messing with Dates in Drupal
Mon, 2010-03-08 17:15 | Franco
Dates and how they are used in drupal is a PITA.
this snippet of code helps to remember the easy way of moving dates back and forth in and out of timestamp format
$today['raw string'] = '2010-03-09 13:00:00';
$today['unix']=strtotime($today['raw string']);
$today['array']=getdate($today['unix']);
$today['YYYY-MM-DD HH:MM:SS']=date("Y-m-d H:i:s",$today['unix']);
$today['drupal-default']=format_date($today['unix']);
dpm ($today);