# Example
import datetime
def days_old(birth_year=1974,birth_month=12,birth_day=7):
return (datetime.date.today() -
datetime.date(birth_year,birth_month,birth_day) ).days
>>> days_old()
12000
krishnakant Mane wrote:
> hello,
> thanks all of you for providing valuable help.
> right now I am
krishnakant Mane wrote:
> hello,
> thanks all of you for providing valuable help.
> right now I am confused about the delta object.
> how can I extract the difference between two dates in terms of day
> using the delta object?
> I tried reading the python docs but did not understand the concept of
hello,
thanks all of you for providing valuable help.
right now I am confused about the delta object.
how can I extract the difference between two dates in terms of day
using the delta object?
I tried reading the python docs but did not understand the concept of
delta object and how can I measure t
On Tue, 16 Oct 2007 18:10:54 +1000, Ben Finney wrote:
> Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes:
>
>> On Tue, 16 Oct 2007 12:33:33 +0530, krishnakant Mane wrote:
>>
>> > firstly, I can't get a way to convert a string like "1/2/2005" in
>> > a genuan date object which is needed for ca
Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes:
> On Tue, 16 Oct 2007 12:33:33 +0530, krishnakant Mane wrote:
>
> > firstly, I can't get a way to convert a string like "1/2/2005" in
> > a genuan date object which is needed for calculation.
>
> Why? Split the string up, convert the parts to
"krishnakant Mane" <[EMAIL PROTECTED]> writes:
> firstly, I can't get a way to convert a string like "1/2/2005" in a
> genuan date object which is needed for calculation.
Until recently, this was a wart in the Python standard library:
datetime objects exist in the 'datetime' module, but parsing s
On Tue, 16 Oct 2007 12:33:33 +0530, krishnakant Mane wrote:
> firstly, I can't get a way to convert a string like "1/2/2005" in a
> genuan date object which is needed for calculation.
Why? Split the string up, convert the parts to `int` and just create a
`datetime.date` object.
> now once this
hello,
I am strangely confused with a date calculation problem.
the point is that I want to calculate difference in two dates in days.
there are two aspects to this problem.
firstly, I can't get a way to convert a string like "1/2/2005" in a
genuan date object which is needed for calculation.
now o