Getting an interesting problem. I am retrieving a time from a database, stored in the form "Thu Jul 12 12:13:19 GMT+01:00 2001". In order to get it into my servlet, I import it as a string. Then, because I want to perform calculations on it, I convert it to date form. To do this, I:
SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd hh:mm:ss zzzzzzzzzz yyyy");
and then,
java.util.Date d = sdf.parse(E);
where E is the string containing the date. This works perfectly for all times and dates with the exception of when the hour is "12" So, for example,
"Thu Jul 12 12:13:19 GMT+01:00 2001"
in the database, once imported and parsed is returned as:
"Thu Jul 12 00:13:19 GMT+01:00 2001"
That is, it interprets both the hours 00 and 12 in the database to be 00, midnight.
Any ideas how I get around this?
Thanks,
James