DateTime object is blank
- by user522962
I am trying to convert a date to a DateTime Object. My code works fine on my localhost (php version 5.3) but returns a blank DateTime object on my remote server (php version 5.2.14). Am I missing something really obvious?
<?php
$d = '2010-01-01';
$n = new DateTime ( $d );
print_r($n);
?>
// result on localhost:
DateTime Object ( [date] => 2010-01-01 00:00:00 [timezone_type] => 3 [timezone] => UTC )
// result on remotehost:
DateTime Object ( ) // is blank