pgcopy/copy.py
def timestamp(_, dt):
    'get microseconds since 2000-01-01 00:00'
    # see http://stackoverflow.com/questions/2956886/
    dt = util.to_utc(dt)
    unix_timestamp = calendar.timegm(dt.timetuple())
    # timetuple doesn't maintain microseconds
    # see http://stackoverflow.com/a/14369386/519015
    val = ((unix_timestamp - psql_epoch) * 1000000) + dt.microsecond
    return ('iq', (8, val))
def timestamp(_, dt):
    'get microseconds since 2000-01-01 00:00'
    # see http://stackoverflow.com/questions/2956886/
    dt = util.to_utc(dt)
    unix_timestamp = calendar.timegm(dt.timetuple())
    # timetuple doesn't maintain microseconds
    # see http://stackoverflow.com/a/14369386/519015
    val = ((unix_timestamp - psql_epoch) * 1000000) + dt.microsecond
    return ('iq', (8, val))
def timestamp ( _ , dt ) : # see http://stackoverflow.com/questions/2956886/ dt = util . to_utc ( dt ) unix_timestamp = calendar . timegm ( dt . timetuple ( ) ) # timetuple doesn't maintain microseconds # see http://stackoverflow.com/a/14369386/519015 val = ( ( unix_timestamp - psql_epoch ) * 1000000 ) + dt . microsecond return ( 'iq' , ( 8 , val ) )
get microseconds since 2000-01-01 00:00
get microseconds since 2000 - 01 - 01 00 : 00