Name

cmp

Synopsis

cmp(obj1,obj2,accuracy=0.0)

Compares two DateTime or DateTimeDelta instances obj1 and obj2, and returns -1, 0, or 1, like the built-in function cmp. It also returns 0 (meaning that obj1 and obj2 are “equal”) if the two instants or durations differ by less than accuracy seconds.

Get Python in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.