Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Something funky in JDate

 
Adam Vinueza
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I write this code:

I get the result as 6 a.m. today. But the documentation says, and the code suggests, that the result should be noon today (in the default time zone, which is wherever your computer happens to be). Has anyone else noticed this, or have I made some mistake?
[ May 05, 2005: Message edited by: Adam Vinueza ]
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[Adam]: But the documentation says, and the code suggests, that the result should be noon today (in the default time zone, which is wherever your computer happens to be)

No, the documentation just says "noon". It doesn't say anything about whether it's using the system default or something else - which means you should really consider this to be unspecified and therefore unreliable. Looking at the source code, it seems that "noon" means noon GMT, not noon local time. Which translates into 6:00 AM in your current time zone. (Hello from Boulder, by the way.)
 
Adam Vinueza
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, that explains it. I was just confused. Thanks for clearing it up!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic