Validate_time_inversion.rst 389 B

12345678910111213141516
  1. Validate time inversion
  2. -----------------------
  3. :Sample Code:
  4. .. code:: python
  5. from datetimerange import DateTimeRange
  6. time_range = DateTimeRange("2015-03-22T10:10:00+0900", "2015-03-22T10:00:00+0900")
  7. try:
  8. time_range.validate_time_inversion()
  9. except ValueError:
  10. print("time inversion")
  11. :Output:
  12. ::
  13. time inversion