On Sep 10, 6:39 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 10 Sep 2007 07:57:58 -0700, [EMAIL PROTECTED] declaimed the > following in comp.lang.python: > > > >from time import * > > >startPoint = strptime(step.sTime, "%H:%S:%M") > > >finishPoint = strptime(step.fTime, "%H:%S:%M") > > > >duration = mktime(startPoint) - mktime(finishPoint) > > Ignoring the mktime() error, shouldn't those be reversed -- end > times are larger than start times... > > > but it generates the error > > > >OverflowError: mktime argument out of range > > I suspect you will need to supply a full date... mktime() wants > calendar date/time values, not some HMS value that is relative to an > arbitrary zero. That is, if your data is in the form "9h 5m, 20s from > start of effort" you need to supply a dummy day representing "start of > effort" (midnight probably) > > Maybe look at the documentation for the datetime module -- in > particular timedelta() > > >>> from datetime import timedelta > >>> pStart = timedelta(hours=9, minutes=5, seconds=20) > >>> pEnd = timedelta(hours=13, minutes=21, seconds=5) > >>> dur = pEnd - pStart > >>> print dur.days, dur.seconds, dur.microseconds > > 0 15345 0 > -- > Wulfraed Dennis Lee Bieber KD6MOG > [EMAIL PROTECTED] [EMAIL PROTECTED] > HTTP://wlfraed.home.netcom.com/ > (Bestiaria Support Staff: [EMAIL PROTECTED]) > HTTP://www.bestiaria.com/
Thanks for all the help, I will have a look at my errors today. Can I also ask does anyone know how I could plot the "gannt chart" looking representation of my data without having to install something such as gnu plot. i.e. how would I simply work out how to move a space accross the screen every 2 seconds, if a Step lasted 45 seconds for example how would I represent that in terms of a print out with spaces? I hope that makes sense! -- http://mail.python.org/mailman/listinfo/python-list