0

I am storing the TimeField in Django with which I want to subtract some minutes and later update the database. This is what I am doing now which results in TpeError: unsupported operand type(s) for -: 'datetime.time' and 'datetime.timedelta'

>>> s.start_time
datetime.time(1, 0)
>>> from datetime import timedelta
>>> s.start_time - timedelta(minutes=30)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
TypeError: unsupported operand type(s) for -: 'datetime.time' and 'datetime.timedelta'

What's wrong?

pynovice
  • 6,802
  • 23
  • 67
  • 104

0 Answers0