Joda Time

General

Category
Free
Tag
Utils
License
N/A
Registered
Jul 5, 2014
Favorites
0
Link
https://github.com/JodaOrg/joda-time
See also
Android Utils
Easy Exchange
RxLifecycleMoxy
Shoot
Android-scaex

Additional

Language
Java
Version
v2.10.1 (Oct 28, 2018)
Created
May 16, 2011
Updated
Nov 2, 2018
Owner
Joda.org (JodaOrg)
Contributors
RenniePet
kluever
seva-ask
CodingFabian
twillouer
ming13
mebigfatguy
sebkur
rowanhill
hansjoachim
tiembo
Pitel
Brian Melton-Grace (iambmelt)
alb-i986
alxndrsn
emopers
Strilanc
plumpy
Show all (67)67
Activity
Badge
Generate
Download
Source code

Announcement

Joda-Time

Joda-Time provides a quality replacement for the Java date and time classes. The design allows for multiple calendar systems, while still providing a simple API. The 'default' calendar is the ISO8601 standard which is used by XML. The Gregorian, Julian, Buddhist, Coptic, Ethiopic and Islamic systems are also included. Supporting classes include time zone, duration, format and parsing.

Joda-time is no longer in active development except to keep timezone data up to date. From Java SE 8 onwards, users are asked to migrate to java.time (JSR-310) - a core part of the JDK which replaces this project. For Android users, java.time is added in API 26+. Projects needing to support lower API levels can use the ThreeTenABP library.

As a flavour of Joda-Time, here's some example code:

public boolean isAfterPayDay(DateTime datetime) {
  if (datetime.getMonthOfYear() == 2) {   // February is month 2!!
    return datetime.getDayOfMonth() > 26;
  }
  return datetime.getDayOfMonth() > 28;
}

public Days daysToNewYear(LocalDate fromDate) {
  LocalDate newYear = fromDate.plusYears(1).withDayOfYear(1);
  return Days.daysBetween(fromDate, newYear);
}

public boolean isRentalOverdue(DateTime datetimeRented) {
  Period rentalPeriod = new Period().withDays(2).withHours(12);
  return datetimeRented.plus(rentalPeriod).isBeforeNow();
}

public String getBirthMonthText(LocalDate dateOfBirth) {
  return dateOfBirth.monthOfYear().getAsText(Locale.ENGLISH);
}

Joda-Time is licensed under the business-friendly Apache 2.0 licence.

Documentation

Various documentation is available:

Releases

Release 2.10.1 is the current latest release. This release is considered stable and worthy of the 2.x tag. It depends on JDK 1.5 or later.

Available in the Maven Central repository

Maven configuration:

<dependency>
  <groupId>joda-time</groupId>
  <artifactId>joda-time</artifactId>
  <version>2.10.1</version>
</dependency>

Gradle configuration:

compile 'joda-time:joda-time:2.10.1'

Related projects

Related projects at GitHub:

Other related projects:

Support

Please use GitHub issues and Pull Requests for support.

History

Issue tracking and active development is at GitHub. Historically, the project was at Sourceforge.

Release process

  • Update version (pom.xml, README.md, index.md, MANIFEST.MF, changes.xml)
  • Commit and push
  • Ensure on Java SE 8
  • mvn clean deploy -Doss.repo -Dgpg.passphrase=""
  • Release project in Nexus
  • Website will be built and released by Travis