obspy.core.utcdatetime.UTCDateTime.__le__

UTCDateTime.__le__(other)[source]

Rich comparison operator ‘<=’.

Comparing two UTCDateTime object will always compare timestamps rounded to a precision of 6 digits by default.

>>> t1 = UTCDateTime(123.000000099)
>>> t2 = UTCDateTime(123.000000012)
>>> t1 <= t2
True

But the actual timestamp differ

>>> t1.timestamp <= t2.timestamp
False

Resetting the precision changes the behavior of the operator

>>> t1.precision = 11
>>> t1 <= t2
False