Fixed a null pointer in the formatted date