Today I found a very mysterious bug in the code. I have used the JodaTime library for a while and it has been consistent ever since.
DateTime dateTime = DateHelper.formatDateTime("25/06/2012");
TestHelper.spot(dateTime);
TestHelper.spot(dateTime.toDate());
Results –
2012-06-25T00:00:00.000+05:30
Mon Jun 25 00:00:00 IST 2012
But in a different java application –
2012-06-25T00:00:00.000+05:30
Sun Jun 24 18:30:00 GMT 2012
DateHelper.formatDateTime() method
public static DateTime formatDateTime(String text) {
DateTimeFormatter format = DateTimeFormat.forPattern("dd/MM/yyyy");
return format.parseDateTime(text);
}
The only issue I suspect is the format (GMT and IST). What can I do to maintain consistency.
I put a VM parameter stating
And after I removed it everything is working like normal. But the problem now is that I can’t connect to Oracle 9i database. It’s giving me the below error.