formatted 'time' data in calculations

Steve Holden steve at holdenweb.com
Thu Jan 8 18:17:13 CET 2009


Ross wrote:
> Scott David Daniels wrote:
>> Ross wrote:
>>> There seems to be no shortage of information around on how to use the
>>> time module, for example to use time.ctime() and push it into
>>> strftime and get something nice out the other side, but I haven't
>>> found anything helpful in going the other way.
>>
>> As to a paucity of conversion formatting, there is no magic way to take
>> everyone's way of putting date and time information in text and convert
>> it to unambiguous format, in part because there are too many different
>> and contradictory formats.  When I write dates, I know what I intended;
>> when I read dates, I guess what the author intended.
>>
>> Have you read the entire time module document?  If so, which functions
>> in that module take strings as arguments?
>>
>>> That is, given some formatted text describing times - is there
>>> something that makes it easy to calculate time differences, or do I
>>> have to index my way through the string pulling out characters,
>>> converting to integers etc...
>>>
>>> Data is formatted:
>>>    t1 = 09:12:10
>>>    t2 = 11:22:14
>>> I want to calculate tdiff = t2-t1
>>
>> Do you do any work yourself?  Show us your attempts.  This looks like
>> a trivial exercise.  It seems that for less than four times the effort
>> of asking your question you might have found the answer.
>>
>> Perhaps I am being too cranky this morning.
> 
> Jeeze, you're quite an ass aren't you?

And how did sending this message improve things? Let's keep it civil, guys.

regards
 Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list