Added functionality to convert string to date