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:
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
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()
>
>
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
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
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
> 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
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
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
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
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
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
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
"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
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
15 matches
Mail list logo