aspose file tools*
The moose likes Java in General and the fly likes Something funky in JDate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Something funky in JDate" Watch "Something funky in JDate" New topic
Author

Something funky in JDate

Adam Vinueza
Ranch Hand

Joined: Apr 16, 2001
Posts: 76
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

Joined: Jan 30, 2000
Posts: 18671
[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.)


"I'm not back." - Bill Harding, Twister
Adam Vinueza
Ranch Hand

Joined: Apr 16, 2001
Posts: 76
Ah, that explains it. I was just confused. Thanks for clearing it up!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Something funky in JDate