[Tutor] time(duration) formats & basic time math query

kevin parks kp8 at mac.com
Thu Jul 6 07:39:30 CEST 2006


I have been handed a huge number of documents which have hundreds of  
pages of times and durations, all calculated and notated by several  
different people over the course of many years. Sadly, no made any  
guidelines at all about how this work would proceed and all the  
documenters had their own ideas about how times/durations would be  
specified so the doc are a mess. Furthermore the person i work for  
changes her mind every 15 minutes so i have no idea what she will  
want at any given moment. This sounds to me like a job for Python  
<hee hee>

Essentially, I am trying to do 2 things:

move fluidly between different duration formats (take any, specify  
and display any). Such as:

pure miliseconds
seconds. msec
mm:ss.msec
hh:mm:ss.msec

So the input doc would be grepped for times and i could just  
uncomment the line i need and get he format my boss wants at this  
particular moment.
So a recording that is 71 minutes and 33 seconds could be printed as:
4293 seconds
71:33.0000
01:11.33.0000      or whatever....

also i need to be able to adjust start times, durations, and end  
times which means doing a little time math.
Like if a recording is 71 minute and 33 seconds.. but there are  
several sonic events in that recording and i
need to specify the duration, or start time etc of those individual  
events... then i need to subtract... Additionally i
know that i will need to subtract pure minutes from an hh:mm format....

I having a real hard time getting my head round the labyrinthian  
datetime module in the docs (i am guessing
that this is what i should use). I wonder if anyone could give me a  
hand and point me in the right direction.

cheers,

kevin




More information about the Tutor mailing list