© Peter Späth and Jeff Friesen 2020
P. Späth, J. FriesenLearn Java for Android Developmenthttps://doi.org/10.1007/978-1-4842-5943-6_17

17. Date and Time

Peter Späth1  and Jeff Friesen2
(1)
Leipzig, Sachsen, Germany
(2)
Winnipeg, MB, Canada
 

Handling dates and times in a computer system is a considerably big challenge. We need to take care of different calendar systems, different time zones, daylight saving switches, and language- and country-dependent date and time formatting.

Java includes a sophisticated date and time handling, which is up to JDK version 7 in the majority of use cases boiled down to using classes java.util.Date, java.util.Calendar, java.text.SimpleDateFormat, and the function System.currentTimeMillis().

Only starting with JDK version ...

Get Learn Java for Android Development: Migrating Java SE Programming Skills to Mobile Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.