Standard class for time *period*?

Loris Bennett loris.bennett at fu-berlin.de
Mon Mar 27 09:00:52 EDT 2023


Hi,

I have been around long enough to know that, due to time-zones, daylight
saving and whatnot, time-related stuff is complicated.  So even if I
think something connected with time should exist, there may well be a
very good reason why it does not.

My problem:

  I need to deal with what I call a 'period', which is a span of time
  limited by two dates, start and end.  The period has a 'duration',
  which is the elapsed time between start and end.  The duration is
  essentially a number of seconds, but in my context, because the
  durations are usually hours or days, I would generally want to display
  the duration in a format such as "dd-hh:mm:ss"

My (possibly ill-founded) expectation:

  There is a standard class which encapsulates this sort of functionality.

My (possibly insufficiently researched) conclusion:

  Such a standard class does not exist.

What is at fault here?  My expectation or my conclusion?

Cheers,

Loris

-- 
This signature is currently under constuction.


More information about the Python-list mailing list