def get_date(datetime, time_format=None):
if time_format is None:<EOL><INDENT>t = du.parser.parse(datetime)<EOL><DEDENT>else:<EOL><INDENT>t = dt.datetime.strftime(datetime, time_format)<EOL><DEDENT>return t<EOL>
Return a datetime oject from a string, with optional time format.

Parameters
----------
datetime : str
    Date-time as string in any sensible format.
time_format : datetime str (optional)
    String describing the datetime format. If missing uses
    dateutil.parser to guess time format.