I have the following DATETIME field value in my database (MySQL):
2000-12-09 00:00:00
Let's call the column name "my_date".
In my Java class, I call:
myCalendar = new GregorianCalendar();
myCalendar.setTime (rs.getDate("my_date"
);
System.out.println(myCalendar.get(Calendar.MONTH) +"\n" + rs.getDate("my_date"
);
I get the following print-out:
2
2001-03-31
Indicating that somewhere the month is being changed from 3 to 2. Does MONTH start with 0? That doesn't seem right, as day and year both print correctly. Why would day or year start at 1 and month start at 0? Liam Morley
lmorley@wpi.edu
"light the deep, and bring silence to the world.
light the world, and bring depth to the silence."
2000-12-09 00:00:00
Let's call the column name "my_date".
In my Java class, I call:
myCalendar = new GregorianCalendar();
myCalendar.setTime (rs.getDate("my_date"
System.out.println(myCalendar.get(Calendar.MONTH) +"\n" + rs.getDate("my_date"
I get the following print-out:
2
2001-03-31
Indicating that somewhere the month is being changed from 3 to 2. Does MONTH start with 0? That doesn't seem right, as day and year both print correctly. Why would day or year start at 1 and month start at 0? Liam Morley
lmorley@wpi.edu
"light the deep, and bring silence to the world.
light the world, and bring depth to the silence."