Skip to Content
Core Java, Volume II: Advanced Features, 13th Edition
book

Core Java, Volume II: Advanced Features, 13th Edition

by Cay S. Horstmann
August 2024
Intermediate to advanced content levelIntermediate to advanced
988 pages
24h 37m
English
Pearson
Content preview from Core Java, Volume II: Advanced Features, 13th Edition

Chapter 6 ▪ The Date and Time API

Time flies like an arrow, and we can easily set a starting point and count forward and backward in seconds. So why is it so hard to deal with time? The problem is humans. All would be easy if we could just tell each other: “Meet me at 1523793600, and don’t be late!” But we want time to relate to daylight and the seasons. That’s where things get complicated. Java 1.0 had a Date class that was, in hindsight, naïve, and had most of its methods deprecated in Java 1.1 when a Calendar class was introduced. Its API wasn’t stellar, its instances were mutable, and it didn’t deal with issues such as leap seconds. The third time is a charm, and the java.time API introduced in Java 8 has remedied the flaws of the past ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Core Java, Volume I: Fundamentals, 13th Edition

Core Java, Volume I: Fundamentals, 13th Edition

Cay S. Horstmann

Publisher Resources

ISBN: 9780135371671