def get_timestamp(d):
 if (isinstance(d, datetime.date) and (not isinstance(d, datetime.datetime))):
  d = datetime.datetime.combine(d, datetime.time(0, 0, 0, 0))
 msec = str(d.microsecond).rjust(6).replace(' ', '0')
 return float(('%s.%s' % (calendar.timegm(d.utctimetuple()), msec)))

def get_timestamp ( d ) : if ( isinstance ( d , datetime . date ) and ( not isinstance ( d , datetime . datetime ) ) ) : d = datetime . datetime . combine ( d , datetime . time ( 0 , 0 , 0 , 0 ) ) msec = str ( d . microsecond ) . rjust ( 6 ) . replace ( ' ' , '0' ) return float ( ( '%s.%s' % ( calendar . timegm ( d . utctimetuple ( ) ) , msec ) ) )
returns a utc timestamp for a c{datetime .