Set_time_range.rst 449 B

12345678910111213141516
  1. Set time range (set both start and end time)
  2. --------------------------------------------
  3. :Sample Code:
  4. .. code:: python
  5. from datetimerange import DateTimeRange
  6. time_range = DateTimeRange()
  7. print(time_range)
  8. time_range.set_time_range("2015-03-22T10:00:00+0900", "2015-03-22T10:10:00+0900")
  9. print(time_range)
  10. :Output:
  11. ::
  12. NaT - NaT
  13. 2015-03-22T10:00:00+0900 - 2015-03-22T10:10:00+0900