def cronite_datetime_to_timestamp(self, d):
 if (d.tzinfo is not None):
  d = (d.replace(tzinfo=None) - d.utcoffset())
 return total_seconds((d - datetime.datetime(1970, 1, 1)))

def cronite_datetime_to_timestamp ( self , d ) : if ( d . tzinfo is not None ) : d = ( d . replace ( tzinfo = None ) - d . utcoffset ( ) ) return total_seconds ( ( d - datetime . datetime ( 1970 , 1 , 1 ) ) )
converts a datetime object d into a unix timestamp .