File: Make_a_subtracted_time_range.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-- 492 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Make an subtracted time range
------------------------------
:Sample Code:
    .. code:: python

        from datetimerange import DateTimeRange
        time_range = DateTimeRange("2015-01-22T09:50:00+0900", "2015-01-22T10:00:00+0900")
        x = DateTimeRange("2015-01-22T09:55:00+0900", "2015-01-22T09:56:00+0900")
        time_range.subtract(x)

:Output:
    ::

        [2015-01-22T09:50:00+0900 - 2015-01-22T09:55:00+0900,
         2015-01-22T09:56:00+0900 - 2015-01-22T10:00:00+0900]