PHP DateTime object has no reflection!

For hours I've been banging my head against a wall trying to figure out why Drupal's date_make_date "wasn't working." I was always getting back an empty PHP DateTime object. I traced it back down to PHP's date_create. I suspected that there was no reflection capabilities, but searching against date_create really didn't yield me much.

Eventually I decided "let's just search up a level (date_make_date empty object)" and in seconds I came across this thread: http://drupal.org/node/514560. This is just proof to me that the Drupal community is super awesome.

Hope this saves other people a bunch of time. If you're trying to just see what time is stored in a PHP DateTime object, print_r won't work - pass it through a format() (date_format()) call first.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h1> <h2> <h3> <h4> <h5> <h6>
  • Lines and paragraphs break automatically.

More information about formatting options