Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Java
  3. Time4J

Time4J

LGPL-2.1Javav5.9.4

Advanced Java date/time library with extensive calendar support, astronomy features, and superior internationalization.

GitHubGitHub
474 stars67 forks0 contributors

What is Time4J?

Time4J is an advanced Java library for date, time, interval, and calendar operations, designed as a complete replacement for legacy Java date/time classes and alternatives like Joda-Time and JSR-310. It solves complex temporal problems with features like leap second support, extensive calendar systems, and superior internationalization for both business and scientific applications.

Target Audience

Java developers needing robust date/time handling, especially those working with multiple calendar systems, scientific applications requiring leap second accuracy, or projects demanding extensive internationalization beyond standard libraries.

Value Proposition

Developers choose Time4J for its comprehensive feature set, type-safe API, explicit design philosophy, and support for over 20 calendars and 95 languages—filling gaps left by JSR-310 and other libraries while maintaining interoperability with java.time.

Overview

Advanced date, time and interval library for Java with sun/moon-astronomy and calendars like Chinese, Coptic, Ethiopian, French Republican, Hebrew, Hijri, Historic Christian, Indian National, Japanese, Julian, Korean, Minguo, Persian, Thai, Vietnamese

Use Cases

Best For

  • Handling multiple calendar systems in international applications
  • Scientific applications requiring accurate leap second support
  • Projects needing extensive date/time internationalization beyond platform resources
  • Replacing legacy Java date/time classes or Joda-Time with a more feature-rich library
  • Building applications with historically accurate dates across different eras
  • Developing Java applications with astronomy-related time calculations

Not Ideal For

  • Projects requiring only basic ISO-8601 date/time operations without multiple calendars or leap seconds
  • Microservices prioritizing minimal dependencies and using built-in Java SE date/time APIs
  • Teams migrating from Joda-Time who prefer a similar API style without learning a new design philosophy
  • Android development without adopting the separate Time4A library

Pros & Cons

Pros

Comprehensive Calendar Systems

Supports over 20 calendars including Chinese, Hebrew, and Persian, as listed in the README, enabling accurate historical and international date handling beyond standard Gregorian.

Leap Second and Scientific Accuracy

Provides precise UTC leap second support and astronomy calculations like sun/moon positions, essential for scientific applications where time scale accuracy is critical.

Type-Safe and Explicit API

Emphasizes compile-time safety and requires explicit locale/timezone specifications, preventing errors like adding clock units to dates, as highlighted in the design remarks.

Powerful Format Engine

Offers high-performance parsing and formatting with extensive customization options, outperforming Joda-Time and JSR-310 in parsing speed according to the README.

Extensive Internationalization

Includes built-in resources for 95 languages with localized duration formatting, filling gaps left by platform resources, as stated in the internationalization section.

Cons

Complex Setup and Modularity

Requires managing multiple modules (e.g., time4j-base, time4j-tzdata) and initialization steps like TZDATA.init() for Java 9+, adding overhead compared to simpler libraries.

Steeper Learning Curve

The element-centric manipulation and explicit APIs are more verbose and conceptually dense, making it harder to adopt quickly than JSR-310's more intuitive design.

Limited Ecosystem and Community

Has a smaller user base and fewer third-party integrations compared to standard Java libraries like java.time, which can affect support and tooling availability.

Past Breaking Changes

The README notes that older version lines v1.x and v2.x are not recommended due to backward incompatibilities, indicating a history of instability in earlier releases.

Open Source Alternative To

Time4J is an open-source alternative to the following products:

j
java.time (JSR-310)

java.time (JSR-310) is the modern date and time API introduced in Java 8, providing comprehensive classes for date, time, and duration manipulation.

J
Joda-Time

Joda-Time is a widely used date and time library for Java, providing a comprehensive set of classes for date and time manipulation before being largely superseded by java.time in Java 8.

Frequently Asked Questions

Quick Stats

Stars474
Forks67
Contributors0
Open Issues20
Last commit2 years ago
CreatedSince 2013

Tags

#interval#sun#date-time#timezone#internationalization#astronomy#java#calendar#type-safe#duration#moon

Built With

J
Java

Included in

Java47.5k
Auto-fetched 1 day ago

Related Projects

iCal4jiCal4j

A Java library for parsing and building iCalendar data models

Stars837
Forks220
Last commit5 days ago
ThreeTen-ExtraThreeTen-Extra

Provides additional date-time classes that complement those in JDK 8

Stars425
Forks84
Last commit9 days ago
JollydayJollyday

Jollyday - A holiday API

Stars197
Forks116
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub