@staticmethod<EOL><INDENT>def _date2int(date):<DEDENT>
if isinstance(date, str):<EOL><INDENT>if date.endswith('<STR_LIT>') or date.endswith('<STR_LIT>'):<EOL><INDENT>date = date[<NUM_LIT:0>:-<NUM_LIT:9>]<EOL><DEDENT>tmp = datetime.datetime.strptime(date, '<STR_LIT>')<EOL>return tmp.toordinal()<EOL><DEDENT>if isinstance(date, datetime.date):<EOL><INDENT>return date.toordinal()<EOL><DEDENT>if isinstance(date, int):<EOL><INDENT>return date<EOL><DEDENT>raise ValueError('<STR_LIT>'.format(date.__class__))<EOL>
Returns an integer representation of a date.

:param str|datetime.date date: The date.

:rtype: int