Use timedelta.total_seconds()
.
>>> import datetime
>>> datetime.timedelta(seconds=24*60*60).total_seconds()
86400.0
More Related Contents:
- Converting datetime.date to UTC timestamp in Python
- Format timedelta to string
- How to convert local time string to UTC?
- How to print pandas DataFrame without index
- How do I convert a datetime to date?
- Trying to mock datetime.date.today(), but not working
- Most recent previous business day in Python
- Convert string date to timestamp in Python
- Getting today’s date in YYYY-MM-DD in Python?
- Parsing time string in Python
- Converting epoch time with milliseconds to datetime
- Query Mongodb on month, day, year… of a datetime
- Splitting timestamp column into separate date and time columns
- Python Create unix timestamp five minutes in the future
- Comparing two date strings in Python
- Get year, month or day from numpy datetime64
- Difference between Python datetime vs time modules
- Natural/Relative days in Python
- Why can’t I subclass datetime.date?
- Extract time from datetime and determine if time (not date) falls within range?
- Python pandas convert datetime to timestamp effectively through dt accessor
- Get time zone information of the system in Python?
- Locate first and last non NaN values in a Pandas DataFrame
- Format of datetime in pyplot axis
- Formatting “yesterday’s” date in python
- Get UTC offset from time zone name in python
- Python: Datetime to season
- finding last business day of a month in python
- Python strptime parsing year without century: assume prior to this year?
- Get weekday/day-of-week for Datetime column of DataFrame