Hello,
I have another question, always on my dates. I get a date as "dd / MM / YYYY" (String), I must first convert the Date type (I must) and then display it separately. Here is my piece of code:
Code:
DateFormat dtf = new SimpleDateFormat("dd / MM / yyyy");
Date d = dtf.parse("22/03/2008");
...
GregorianCalendar geo = new GregorianCalendar();
geo.setTime(d);
int month = geo.get(GregorianCalendar.MONTH);
int year = geo.get(GregorianCalendar.YEAR);
int day = geo.get(GregorianCalendar.DAY_OF_MONTH);
...
System.out.System.out.println("Day" + + Day "Month" Month + + "Year" + Year);
The display of the day and year is correct but the display of the month is always smaller than 1! In this case, the displayed month is 02 ... Do you know where is the problem? Thanks in advance.
Bookmarks