Fixing undefined variable in datetime.php class.

Addresses #2593.