posted 10 years ago
I'd use HH, not hh. hh returns something between 01 and 12 inclusive. midnight in hh:mm:ss is 12:00:00 (AM, not PM).
About your issue. The date is probably 21:00:01 on December 31st 1969. That indicates there's indeed a timezone issue. If I run your code I get 001:01:00:01,000. Changing the time zone of the Calendar does not help. However, you can also change the time zone of your SimpleDateFormat. If I do that I get 001:12:00:01,000 (or 001:00:00:01,000 if I switch to HH).
On a side note, you can drop the Calendar completely. You create a Calendar, set its time, then retrieve that time again. You can create a Date directly: