• Post Reply Bookmark Topic Watch Topic
  • New Topic

SimpleDateFormat seems to be adding an hour  RSS feed

 
Simon Birch
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm sure this must be something daft on my part.

When the expected output is 00:03:16.492, I'm getting 01:03:16.492
When the expected output is 01:19:56.492, I'm getting 02:19:56.492
If I try setting the time to 0 I get 01:00:00.000

Here is the code;
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check into setting the timezone on your date or formatter. You may have a default that's adjusting for daylight savings time or something. Follow the JavaDoc trail ... somewhere in there it will tell you how to have none or how to make a generic timezone that doesn't convert anything. I'm not giving you concrete answers a) it's more fun for you to find them yourself and b) I've forgotten since the last time this bit me. Show us what you figure out!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!