fix compatibility with php < 5.4; fix date timezone warning