[PYTHON] Misunderstanding due to datetime type subtraction

In python, subtraction between datetime types is datetime.timedelta type

As the variable name poko at this time

poko.seconds
poko.days

You can access and take the difference like

Misunderstanding point

I thought seconds would return the difference, but it's moved up by date

What that means is that if the difference is 1 day and 30 seconds, it's 86400 + 30. I thought it would return 86430, but I actually get 30.

Days are incremented to 0-> 1

I got stuck in that

Recommended Posts

Misunderstanding due to datetime type subtraction
How to handle datetime type in python sqlite3
0 Convert unfilled date to datetime type with regular expression
python> datetime> From date string (ISO format: 2015-12-09 12:40:08) to datetime type