seconds

How do I get seconds since 1/1/1970 of a Python datetime object?

How do I get seconds since 1/1/1970 of a Python datetime object? Question: I’m using Python 3.7 and Django. I wanted to get the number of seconds (or milliseconds) since 1/1/1970 for a datetime object. Following the advice here — In Python, how do you convert a `datetime` object to seconds?, I implemented now = …

Total answers: 5

How to return total time in seconds given a column with only hour-minute-second format

How to return total time in seconds given a column with only hour-minute-second format Question: I have a pandas DataFrame with a column with 00:00:00 (hour, minute, second) format. import pandas as pd # sample dataframe df = pd.DataFrame({‘Time’: [’00:01:00′, ’00:00:30′, ’00:01:30′, ’00:00:10′]}) Time 0 00:01:00 1 00:00:30 2 00:01:30 3 00:00:10 I need to …

Total answers: 2