def datetime_to_utc_timestamp(timeval):
 if (timeval is not None):
  return (timegm(timeval.utctimetuple()) + (timeval.microsecond / 1000000))

def datetime_to_utc_timestamp ( timeval ) : if ( timeval is not None ) : return ( timegm ( timeval . utctimetuple ( ) ) + ( timeval . microsecond / 1000000 ) )
converts a datetime instance to a timestamp .