Top "Timedelta" questions

Timedelta refers to the difference between two timestamps, which is a measure of elapsed time.

How to convert a timedelta object into a datetime object

What is the proper way to convert a timedelta object into a datetime object? I immediately think of something like …

python datetime timedelta
Python: How do you convert a datetime/timestamp from one timezone to another timezone?

Specifically, given the timezone of my server (system time perspective) and a timezone input, how do I calculate the system …

python datetime timezone pytz timedelta
Python timedelta issue with negative values

Hi I need some help to understand why this is happening. I have a method to track 'time remaining' in …

python timedelta
Why is Python datetime time delta not found?

I am trying to make an array of dates in mmddyyyy format. The dates will start on the current day …

python timedelta python-datetime
Subtracting n days from date in Python

I want to subtract n days from a file's timestamp, but it doesn't seem to be working. I have read …

python python-2.7 datetime timedelta
calculate datetime-difference in years, months, etc. in a new pandas dataframe column

I have a pandas dataframe looking like this: Name start end A 2000-01-10 1970-04-29 I want to add …

python datetime pandas timedelta
Python Pandas: TypeError: unsupported operand type(s) for +: 'datetime.time' and 'Timedelta'

I am attempting to add two series in a dataframe in pandas with the first series being a 24-hr time …

python pandas python-3.6 timedelta python-datetime
How to find the date n days ago in Python?

Good evening chaps, I would like to write a script where I give python a number of days (let s …

python-2.7 date datetime timedelta
How do I remove the microseconds from a timedelta object?

I do a calculation of average time, and I would like to display the resulted average without microseconds. avg = sum(…

python datetime format timedelta
AttributeError: 'Series' object has no attribute 'days'

I have a column 'delta' in a dataframe dtype: timedelta64[ns], calculated by subcontracting one date from another. I am …

python attributeerror timedelta