Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sum up Time difference
#9
You guys did your best, I'm sure it all makes sens but not for my level of understanding..
Sorry about that!
I do not see how I can get from this:
 START TIME = 4/3/2023 4:18:57 PM
 END TIME = 4/3/2023 4:20:02 PM
 Time Difference  = 0:01:05-<class 'datetime.timedelta'>
 START TIME = 4/3/2023 4:24:06 PM
 END TIME = 4/3/2023 4:25:08 PM
 Time Difference  = 0:01:02-<class 'datetime.timedelta'>
to this:
deltas = [timedelta(hours=1, minutes=35, seconds=42) for _ in range(10)]
 
print(sum(deltas, timedelta(seconds=0)))
or to this:
x = timedelta(days=1), timedelta(days=1)
total = sum(a.total_seconds() for a in x)
print(total)
this is complicated... And I really appreciate your help!

Thank you guys, you are the best, I'll get it someday.
Reply


Messages In This Thread
Sum up Time difference - by tester_V - Apr-05-2023, 05:15 AM
RE: Sum up Time difference - by Gribouillis - Apr-05-2023, 06:19 AM
RE: Sum up Time difference - by tester_V - Apr-05-2023, 06:04 PM
RE: Sum up Time difference - by deanhystad - Apr-05-2023, 07:31 PM
RE: Sum up Time difference - by deanhystad - Apr-05-2023, 06:34 PM
RE: Sum up Time difference - by tester_V - Apr-05-2023, 08:33 PM
RE: Sum up Time difference - by snippsat - Apr-05-2023, 06:55 PM
RE: Sum up Time difference - by deanhystad - Apr-05-2023, 08:52 PM
RE: Sum up Time difference - by tester_V - Apr-05-2023, 09:43 PM
RE: Sum up Time difference - by deanhystad - Apr-06-2023, 03:06 AM
RE: Sum up Time difference - by Gribouillis - Apr-06-2023, 06:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  time difference bettwenn logs enkliy 14 1,154 Nov-21-2023, 04:51 PM
Last Post: rob101
  Hard time trying to figure out the difference between two strings carecavoador 2 720 Aug-16-2023, 04:53 PM
Last Post: carecavoador
  How to get indices of minimum time difference Mekala 1 2,209 Nov-10-2020, 11:09 PM
Last Post: deanhystad
  How to calculate time difference between each row of dataframe in seconds Mekala 1 2,632 Jul-16-2020, 12:57 PM
Last Post: Larz60+
  Correlation of Incidents using time difference Rajhesh 1 1,872 Jun-27-2019, 03:44 PM
Last Post: Larz60+
  Time Difference in Epoch Microseconds then convert to human readable firesh 4 11,690 Feb-27-2018, 09:08 AM
Last Post: firesh
  Calculating time difference between times and splitting the HH and MM Bass 7 10,729 Jul-03-2017, 01:26 PM
Last Post: Bass

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020