Date formatting should be null-safe

The examples are not working:
Call to a member function format() on a non-object in invite.php on line 469

Date formatting should be null-safe.