How are dates represented in Java?
• A. java.util.Date stores dates as long integers representing the number of milliseconds since 00:00:00 UTC Jan 1, 1970 (the birth of Unix, a date known as the “Epoch”). Dates earlier than the Epoch are represented as negative numbers, counting away from 1/1/1970. The scheme is sufficient to represent dates from 292,269,053 B.C. to 292,272,993 A.D. (64 bits covers -9223372036854775808 to +9223372036854775807 millesecs so divide by 1000 to get secs, divide that by 3600*24*365.25 to get years, and you get -2.9227E8 to 2.9227E8 centered on the Epoch i.e. about 292,269,053 BC to 292,272,993 AD). In JDK 1.1, Date was augmented by Calendar. Things didn’t get any better. Instead of being ill-conceived and simple, it is now ill-conceived and complicated. The code was all licensed from Taligent. It didn’t really improve matters. Dates are the lemon of Java, as Roedy Green truly notes. You could consider using the BigDate class written by Roedy, and available at http://oberon.ark.