Search |
||
Dating 101Posted by joconner on March 6, 2007 at 9:40 AM PST
The Almost immediately, Java engineers corrected the error by deprecating most of Date's API. Unfortunately, deprecation just means that the APIs are old, stale, and shouldn't be used. Usually, newer APIs improve the functionality that the deprecated methods should have provided from the beginning. Deprecated methods, however, never seem to actually go away. Regardless whether the methods are still available, you should take this simple message to heart: deprecated methods should not be used. If you should never use deprecated methods, what can you do with a When you create a Date now = new Date(); Date otherTime = new Date(aLongValue); The first option creates a snapshot of time right now at the time of instantiation. The second allows you to create a date from a long millisecond value, maybe a value that you had serialized or stored as a timestamp in a db. I think the important thing to remember about More complex creation and manipulation of Dates will always involve another set of classes, typically a Calendar and TimeZone. Stay tuned for more on that... »
Related Topics >>
Open JDK Comments
Comments are listed in date ascending order (oldest first)
|
||
|
|