How to use Python to calculate time

前端 未结 5 1019
傲寒
傲寒 2021-02-05 22:32

I want to write python script that acts as a time calculator.

For example:

Suppose the time is now 13:05:00

I want to add 1 hour, 23 minutes, and 10 seco

5条回答
  •  面向向阳花
    2021-02-05 22:58

    The datetime class in python will provide everything you need. It supports addition, subtraction and many other operations.

    http://docs.python.org/library/datetime.html

提交回复
热议问题