Fails gracefully if datetime not defined

Fixes #7