The editor here is wreaking a little havoc with my code, but I'm going to hope you can decipher what I'm after here. I have simplified this code bit about as far as I can to isolate the problem, while still leaving it executable:
import java.text.*;
class dateTest {
public static void main (String[] args) throws Throwable {
SimpleDateFormat sdf = new SimpleDateFormat("MM/DD/yyyy");
String data = "07/12/2007";
System.out.println(sdf.parse(data));
}
}
The problem is, the output looks like this:
Fri Jan 12 00:00:00 CST 2007
Month parsing doesn't seem to be working at all. I've done this dozens of times and I'm starting to think maybe I'm losing it. :)
2007-08-23
11:51:39
·
2 answers
·
asked by
David G
5
in
Computers & Internet
➔ Programming & Design
I don't think either of the answers so far has seen the essence of the problem: The seventh month is not JANUARY.
I think this looks like a bug that may have been introduced in a recent Java update. I'm hoping someone has genuine insight into why this is working the way it does.
2007-08-24
01:37:58 ·
update #1