Hi Ramana,
here's one way of doing it....

import time

d=raw_input("enter date in format dd/mm/yyyy ")

try:
#--convert input to a tuple of (year, month, day)
d_tup=(int(d[6:]),int(d[3:5]),int(d[0:2]))
#--time.localtime() returns a tuple in the format
#(year, month, day, hour, minute,second,etc....)
now=time.localtime()
#--we only want to compare the date, so remove the time information
today=(now[0],now[1],now[2])
#--compare the tuples
if d_tup if d_tup==today: result="present"
if d_tup>today: result="future"
#--print the result
print "That date is in the %s!"%result
except:
#--above code will fail if the wrong format is entered.
print "wrong format entered"


Raghuram Devarakonda wrote:
> Please look at datetime module documentation.
>
> On 10/30/07, Ramana wrote:
>
>> Hi All,
>>
>> Can any one help me in comparing dates in Jython.
>>
>> For example: How do i compare a particulare date in 'mm/dd/yyyy' format with
>> the current date and determine whether its a future date or past date ?
>>
>> Thanks in advance
>>
>> -Ramana
>>
>> --
>> DREAM IT, DO IT
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Splunk Inc.
>> Still grepping through log files to find problems? Stop.
>> Now Search log events and configuration files using AJAX and a browser.
>> Download your FREE copy of Splunk now>> http://get.splunk.com/
>> _______________________________________________
>> Jython-users mailing list
>> Jython-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jython-users
>>
>>
>>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now>> http://get.splunk.com/
> _______________________________________________
> Jython-users mailing list
> Jython-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jython-users
>
>
>

--
please ignore the following crap, which has been appended by Micro$oft without my permission.




Play Movie Mash-up and win BIG prizes!