Re: time difference interms of day

2010-10-26 Thread M.-A. Lemburg
Steve Holden wrote: > On 10/24/2010 1:55 PM, mukkera harsha wrote: >> Hello >> I was wondering if there is an existing function that would let me >> determine the difference in time. To explain: >> >> Upon starting a program: >> >> startup = time.time() >> >> After some very long processing:

Re: time difference interms of day

2010-10-24 Thread Jonas H.
On 10/24/2010 07:55 PM, mukkera harsha wrote: On, doing now - startup I want the program to return in terms of days. How ? >>> import datetime >>> now = datetime.datetime.now() >>> after_few_seconds = datetime.datetime.now() >>> after_few_seconds - now datetime.timedelta(0, 14, 256614) >>> (aft

Re: time difference interms of day

2010-10-24 Thread Steve Holden
On 10/24/2010 1:55 PM, mukkera harsha wrote: > Hello > I was wondering if there is an existing function that would let me > determine the difference in time. To explain: > > Upon starting a program: > > startup = time.time() > > After some very long processing: > now = time.time() > >

time difference interms of day

2010-10-24 Thread mukkera harsha
Hello I was wondering if there is an existing function that would let me determine the difference in time. To explain: Upon starting a program: startup = time.time() After some very long processing: now = time.time() On, doing now - startup I want the program to return in terms of days. How

Re: How to find out a date/time difference

2006-05-24 Thread Klaus Alexander Seistrup
Nico Grubert skrev: > you could do this: > > >>> a = datetime.datetime(2006, 5, 24, 16, 1, 26) > >>> b = datetime.datetime(2006, 5, 20, 12, 1, 26) > >>> a-b > datetime.timedelta(4) > # 4 days Or #v+ >>> print (a-b).days 4 >>> #v- Mvh, -- Klaus Alexander Seistrup SubZeroNet, Copenhagen, De

Re: How to find out a date/time difference

2006-05-24 Thread [EMAIL PROTECTED]
And if you want the number of days: py> d = datetime.datetime(2006,5,24,16,34) - datetime.datetime(2006,5,23,12,1) py> d.days 1 py> d = datetime.datetime(2006,5,24,16,34) - datetime.datetime(2006,5,23,19,1) py> d.days 0 -- http://mail.python.org/mailman/listinfo/python-list

Re: How to find out a date/time difference

2006-05-24 Thread Nico Grubert
> I use datetime class in my program and now > I have two fields that have the datetime format like this > datetime.datetime(2006, 5, 24, 16, 1, 26) > How can I find out the date/time difference ( in days) of such two > fields? Hi Lad, you could do this: >>> a

Re: How to find out a date/time difference

2006-05-24 Thread Klaus Alexander Seistrup
Lad skrev: > How can I find out the date/time difference ( in days) of such > two fields? Did you try to subtract one value from the other? Mvh, -- Klaus Alexander Seistrup SubZeroNet, Copenhagen, Denmark http://magnetic-ink.dk/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to find out a date/time difference

2006-05-24 Thread SaskMan
Convert datetime.datetime(2006, 5, 24, 16, 1, 26) to an ordinal number like: datetime.datetime(2006, 5, 24, 16, 1, 26).toordinal() and subtract them to get number of days. -- http://mail.python.org/mailman/listinfo/python-list

How to find out a date/time difference

2006-05-24 Thread Lad
I use datetime class in my program and now I have two fields that have the datetime format like this datetime.datetime(2006, 5, 24, 16, 1, 26) How can I find out the date/time difference ( in days) of such two fields? Thank you for help? L -- http://mail.python.org/mailman/listinfo/python

Re: Time Difference

2004-12-20 Thread Gabriel Cooper
GMane Python wrote: Hello I was wondering if there is an existing function that would let me determine the difference in time. For a more robust solution, checkout Python's profile module. http://docs.python.org/lib/profile.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Time Difference

2004-12-17 Thread Peter Hansen
GMane Python wrote: Hello I was wondering if there is an existing function that would let me determine the difference in time. To explain: Upon starting a program: startup = time.time() After some very long processing: now = time.time() print, now - startup So, to print in a formatted way (D

Re: Time Difference

2004-12-17 Thread Frans Englich
On Friday 17 December 2004 15:40, Fredrik Lundh wrote: > "GMane Python" <[EMAIL PROTECTED]> wrote: > > I was wondering if there is an existing function that would let me > > determine the difference in time. To explain: > > > > Upon starting a program: > > > > startup = time.time() > > > > After

Re: Time Difference

2004-12-17 Thread Fredrik Lundh
"GMane Python" <[EMAIL PROTECTED]> wrote: > I was wondering if there is an existing function that would let me > determine the difference in time. To explain: > > Upon starting a program: > > startup = time.time() > > After some very long processing: > now = time.time() > > print, now - star

Time Difference

2004-12-17 Thread GMane Python
Hello I was wondering if there is an existing function that would let me determine the difference in time. To explain: Upon starting a program: startup = time.time() After some very long processing: now = time.time() print, now - startup So, to print in a formatted way (D-H-M-S) the dif