File: Compare_time_ranges.rst

package info (click to toggle)
python-datetimerange 2.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 476 kB
  • sloc: python: 1,891; makefile: 256; sh: 5
file content (16 lines) | stat: -rw-r--r-- 447 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Compare time ranges
-------------------
:Sample Code:
    .. code:: python

        from datetimerange import DateTimeRange
        lhs = DateTimeRange("2015-03-22T10:00:00+0900", "2015-03-22T10:10:00+0900")
        rhs = DateTimeRange("2015-03-22T10:00:00+0900", "2015-03-22T10:10:00+0900")
        print("lhs == rhs: ", lhs == rhs)
        print("lhs != rhs: ", lhs != rhs)

:Output:
    ::

        lhs == rhs:  True
        lhs != rhs:  False