Modified datetime/date_str functions

Modified datetime_to_date function to use built-in datetime strftime
method and modified date_to_datetime to parse the date string with a
regular expression.