Move_the_time_range.rst 490 B

12345678910111213141516
  1. Move the time range
  2. -------------------
  3. :Sample Code:
  4. .. code:: python
  5. import datetime
  6. from datetimerange import DateTimeRange
  7. value = DateTimeRange("2015-03-22T10:10:00+0900", "2015-03-22T10:20:00+0900")
  8. print(value + datetime.timedelta(seconds=10 * 60))
  9. print(value - datetime.timedelta(seconds=10 * 60))
  10. :Output:
  11. ::
  12. 2015-03-22T10:20:00+0900 - 2015-03-22T10:30:00+0900
  13. 2015-03-22T10:00:00+0900 - 2015-03-22T10:10:00+0900