About 1,300,000 results
Open links in new tab
  1. python - Understanding timedelta - Stack Overflow

    Because timedelta objects can be passed seconds, milliseconds, days, etc... so you need to specify what are you passing in (this is why you use the explicit key).

  2. How do I find the time difference between two datetime objects in …

    Warning: Caveat about built-in .seconds and .microseconds datetime.seconds and datetime.microseconds are capped to [0,86400) and [0,10^6) respectively. They should be …

  3. What is the standard way to add N seconds to datetime.time?

    Sep 19, 2008 · There is timedelta class for manipulations with date and time. datetime minus datetime gives timedelta, datetime plus timedelta gives datetime, two datetime objects cannot …

  4. How to convert a python datetime.timedelta to years?

    I need to check if n years have been since some date. I'm using timedelta from the datetime module and I don't know how to convert it to years.

  5. How to subtract datetimes with python - Stack Overflow

    How to subtract datetimes with python Asked 14 years, 10 months ago Modified 2 years, 8 months ago Viewed 86k times

  6. python - Using datetime.timedelta to add years - Stack Overflow

    Jan 28, 2019 · I looked at the datetime and datetime.timedelta docs class datetime.timedelta (days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)¶. …

  7. python - How to subtract a day from a date? - Stack Overflow

    Jan 13, 2009 · I have a Python datetime.datetime object. What is the best way to subtract one day?

  8. python - How to calculate number of days between two given …

    For example, in the following example, the time difference between the two datetimes is 5 hours and if we use timedelta.days to get the number of days, that difference becomes 0 days or -1 …

  9. How do I convert datetime.timedelta to minutes, hours in Python?

    Jan 7, 2013 · A datetime.timedelta corresponds to the difference between two dates, not a date itself. It's only expressed in terms of days, seconds, and microseconds, since larger time units …

  10. Adding days to a date in Python - Stack Overflow

    I have a date "10/10/11(m-d-y)" and I want to add 5 days to it using a Python script. Please consider a general solution that works on the month ends also. I am using following code: