I'm trying to take a date object that's coming out of my Drupal CMS, subtract one day and print out both dates. Here's what I have
$date_raw = $messagenode->field_message_date['value']; print($date_raw); //this gives me the following string: 2011-04-24T00:00:00 $date_object = date_create($date_raw); $next_date_object = date_modify($date_object,'-1 day'); print('First Date ' . date_format($date_object,'Y-m-d')); //this gives me the correctly formatted string '2011-04-24' print('Next Date ' . date_format($next_date_object,'Y-m-d')); //this gives me nothing. The output here is always blank
So I'm not understanding why the original date object is coming out fine, but then I'm trying to create an additional date object and modify it by subtracting one day and it seems like I can't do that. The output always comes out blank.