Agile Javaв„ў: Crafting Code with Test-Driven Development

If you browse through the J2SE API documentation for the package java.util, you will see several classes that are related to times and dates, including Calendar, GregorianCalendar, Date, TimeZone, and SimpleTimeZone. The Date class provides a simple timestamp mechanism. The other, related classes work together with Date to provide exhaustive support for internationalized dates and for working with components of a timestamp.

Initial versions of Java shipped with the Date class as the sole provider of support for dates and times. The Date class was designed to provide most of the functionality needed. It is a simple implementation: Internally, a date is represented by the number of milliseconds (thousandths of a second) since January 1, 1970 GMT at 00:00:00 (known as the "epoch").

Категории