This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Something funky in JDate
 
Similar Threads
DaysOld, which methods in the class JDate to use?
Posting Density Stastics
java command not finding jar file
JDate not found in JDateTest
stuck in JDK 1.1.8