Implement code for converting date string to object