Question: I have two date-hour column `A` and `B` of type shown below. Both colum are in a Dataframe (pandas).

```
yyyy-mm-dd hh:mm:ss

```

I create

```
df['difference'] = df['A'] - df['B']

```

I get a format like 

```
0 days 00:01:13

```

I would prefer to have a column which contains the seconds in integer. For instance, I need to get 73 in my above example instead of 1min13.

How to do that?

Answer: 
We can use `total_seconds`

```
(df['A'] - df['B']).dt.total_seconds()

```
```
from datetime import datetime, time
#Specified date
date1 = datetime.strptime('2015-01-01 01:00:00', '%Y-%m-%d %H:%M:%S')
import datetime
old_time = date1
print(old_time)
new_time = old_time - datetime.timedelta(hours=2, minutes=10)
print(new_time)

```