how to get the month value in a date?

I am retrieving a Date from the database using the getDate() method! However, I want the value of the month in this obtained result, which i want to compare with an integer!

I dont see any other option but to use the deprecated getMonth() method on this Date object! Or rather get the date as a String & apply the substring methods to get the reqd value!

Is there any other go on this?

[409 byte] By [DreamChassera] at [2007-10-3 3:40:01]
«« hi
»» MouseListener
# 1
HiYou can use GregorianCalendar.Date d = new Date();Calendar c = new GregorianCalendar();c.setTime(d);System.out.println(c.get(Calendar.MONTH)+1);-nmw-
-nmw-a at 2007-7-14 21:35:33 > top of Java-index,Core,Core APIs...