在Python中将N秒添加到datetime.time的标准方法是什么?
给定datetime.timePython中的值,是否有标准的方法向其添加整数秒,例如11:34:59+ 3 = 11:35:02? 这些明显的想法行不通: >>> datetime.time(11, 34, 59) + 3 TypeError: unsupported operand type(s) for +: 'datetime.time' and 'int' >>> datetime.time(11, 34, 59) + datetime.timedelta(0, 3) TypeError: unsupported operand type(s) for +: 'datetime.time' and 'datetime.timedelta' >>> datetime.time(11, 34, 59) + datetime.time(0, 0, 3) TypeError: unsupported operand type(s) for +: …