Prevent PHP notices and broken time displays

Bug: 73111
Change-Id: I69c22e8b61e65fe2ec881f6401e4eb9e809900dd
(cherry picked from commit 932738df9ba179b3c9d10b13fbe764c2aac8f62d)