About 52 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 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.

  3. 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)¶. These works if I want …

  4. 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 like months and …

  5. python - Format timedelta to string - Stack Overflow

    Jun 30, 2013 · I'm having trouble formatting a datetime.timedelta object. Here's what I'm trying to do: I have a list of objects and one of the members of the class of the object is a timedelta object that sh...

  6. 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:

  7. how to calculate timedelta python - Stack Overflow

    Aug 4, 2010 · What I am trying to do is to subtract 7 hours from a date. I searched stack overflow and found the answer on how to do it here. I then went to go read the documentation on timedelta …

  8. python - How to convert timedelta to hours - Stack Overflow

    May 30, 2020 · How to convert timedelta to hours Asked 5 years, 7 months ago Modified 17 days ago Viewed 7k times

  9. datetime - subtract two times in python - Stack Overflow

    11 The python timedelta library should do what you need. A timedelta is returned when you subtract two datetime instances.

  10. Convert a timedelta to days, hours and minutes - Stack Overflow

    If you have a datetime.timedelta value td, td.days already gives you the "days" you want. timedelta values keep fraction-of-day as seconds (not directly hours or minutes) so you'll indeed have to …