Time4J-Tutorial: Overview

Table Of Contents

Download and installation
Introduction to basic types
Element centric approach
Conversions between basic types
Integration with Java
The format and parse engine
How to handle a duration?
Design and role of the class ZonalDateTime
Working with time scales
Appendix: Feature comparison

Module structure

Time4J is organized in modules. The core-module is mandatory and contains following packages:

There are some extra modules which are optional. The term "optional" means that you can leave out these modules from classpath if you don't need the associated features for example in order to save space on mobile platforms.

The olson-module provides access to the historized timezone data of the JDK which are based on the IANA-timezone repository:

The tzdata-module represents an independent timezone repository based on the TZDB of IANA and overrides the timezone data of the JDK (if the JDK-version is not newer). This module requires the core- AND the olson-module.

The i18n-module is necessary if you want to get extended localized support especially for formatting of durations or stand-alone months etc.

The calendar-module consists of the package net.time4j.calendar and is necessary if you need to work with alternative calendars like the islamic one. It requires the presence of the i18n-module.

The range-module consists of the package net.time4j.range and is necessary if you need to work with intervals. It requires the presence of the i18n-module.

The misc-module contains miscellaneous extra features. It requires the presence of the i18n-module.

The ui-module contains a graphical calendar chooser for JavaFX. It requires the presence of the calendar-module and the range-module.

The tool-module consists of the package net.time4j.tool and is only relevant for the creation and compilation of resources for Time4J. It also contains the timezone repository compiler. Standard applications have no need for this module in most cases.