File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Date, Calendar, DateFormat Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Date, Calendar, DateFormat" Watch "Date, Calendar, DateFormat" New topic
Author

Date, Calendar, DateFormat

Jennifer Wallace
Ranch Hand

Joined: Nov 30, 2001
Posts: 102
Is there a book/Website where concepts about Date are laid out real good other than the API.
I have tried studying the API but not able to absorb all the information given there.I have so many questions ... like what is the big deal/significance about January 1, 1970 etc ?
Thanks,
Jennifer
Rob Ross
Bartender

Joined: Jan 07, 2002
Posts: 2205
Not sure about the significance of that date, but's really not that important. It's just a relative marker in time. Time is measured as a displacement relative to that date. Since the underlying data behind a Date() is a long, that will let you address +/- 292 Million years from Jan 1 1970, to a precision of a millisecond.
So in the great scheme of things it really wouldn't matter if the "origin" date was 1/1/1000 or 11/11/1967, etc.


Rob
SCJP 1.4
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18670
Dunno a good, simple, clear resource offhand - I'll leave that to others. As for Jan 1, 1970 - it's just an arbitrary starting point. It was chosen in the early seventies as the reference point used on UNIX systems - simply because it was in the recent past, and had a nice round number. It became standard since then, mostly because there was no particular need to change it. Java was built to appeal to C/C++ programmers, who were used to this sort of thing, and so here we are. It may well still be in use millennia from now, with no one remembering why. (In the novels of Vernor Vinge, people figure it marked the first space flight - even though the time isn't quite right for it. Kind of like how the birth of Christ is now generally believed to be around 4 B.C.)
Ok, so maybe that would've been better in Meaningless Drivel. So, does anyone else have a nice clear resource for this stuff? (Historical minutae are optional.)


"I'm not back." - Bill Harding, Twister
Jason Travis
Greenhorn

Joined: Feb 22, 2002
Posts: 14
I am not aware of a place (web site) where you can get detailed information about the Date API. But if I may make a suggestion, you may wish to use the Calendar API as Date is deprecated.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18670
Bologna. Date is not deprecated. Many specific methods are, but the class itself is alive and well. And Calendar is an ugly monstrosity of a class that takes a huge amount of memory if you're just trying to store a value. It's a good way to manipulate dates, but not to store them. The relationship between Calendar and Date is similar to that between StringBuffer and String. Except that the latter two classes are much better designed.
 
I agree. Here's the link: http://jrebel.com/download
 
subject: Date, Calendar, DateFormat
 
Similar Threads
change date format
Util package date
Class OR object ???
Date validation in JAVA
How to check a date is within range of dates ?