date time fixes and test cases