(dte)
Convert a *dte* into a valid unix timestamp.
Convert a *dte* into a valid unix timestamp.
Convert a * dte * into a valid unix timestamp .
def date2timestamp(dte):
    '''Convert a *dte* into a valid unix timestamp.'''
    seconds = mktime(dte.timetuple())
    if isinstance(dte, datetime):
        return seconds + dte.microsecond / 1000000.0
    else:
        return int(seconds)
def date2timestamp ( dte ) : seconds = mktime ( dte . timetuple ( ) ) if isinstance ( dte , datetime ) : return seconds + dte . microsecond / 1000000.0 else : return int ( seconds )