PHP's DateTime between 5.2 and 5.3

Is very annoying to have different PHP version between development, staging, live and client machine. Regardless what, must force everyone to upgrade to version 5.3.x.

Interval
$datetime = new DateTime();
$datetime->add(new DateInterval('P1D')); // 5.3
$datetime->modify('+1 day'); // 5.2

Timestamp
$datetime = new DateTime();
$datetime->getTimestamp(); // 5.3
$datetime->format('U'); // 5.2

No comments:

Post a Comment