added a date parsing method