Added tests & fixed datetime format issue