- Notifications
You must be signed in to change notification settings - Fork984
Joda-Time is the widely used replacement for the Java date and time classes prior to Java SE 8.
License
JodaOrg/joda-time
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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 tojava.time
(JSR-310) - a core part of the JDK which replaces this project.For Android users,java.time
isadded in API 26+.Projects needing to support lower API levels can usethe ThreeTenABP library.
As a flavour of Joda-Time, here's some example code:
publicbooleanisAfterPayDay(DateTimedatetime) {if (datetime.getMonthOfYear() ==2) {// February is month 2!!returndatetime.getDayOfMonth() >26; }returndatetime.getDayOfMonth() >28;}publicDaysdaysToNewYear(LocalDatefromDate) {LocalDatenewYear =fromDate.plusYears(1).withDayOfYear(1);returnDays.daysBetween(fromDate,newYear);}publicbooleanisRentalOverdue(DateTimedatetimeRented) {PeriodrentalPeriod =newPeriod().withDays(2).withHours(12);returndatetimeRented.plus(rentalPeriod).isBeforeNow();}publicStringgetBirthMonthText(LocalDatedateOfBirth) {returndateOfBirth.monthOfYear().getAsText(Locale.ENGLISH);}
Joda-Time is licensed under the business-friendlyApache 2.0 licence.
Various documentation is available:
- Thehome page
- Two user guides -quick andfull
- TheJavadoc
- TheFAQ list
- Information ondownloading and installing Joda-Time including release notes
Release 2.13.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 theMaven Central repository
Maven configuration:
<dependency> <groupId>joda-time</groupId> <artifactId>joda-time</artifactId> <version>2.13.1</version></dependency>
Gradle configuration:
compile'joda-time:joda-time:2.13.1'
Related projects at GitHub:
- https://github.com/JodaOrg/joda-time-hibernate
- https://github.com/JodaOrg/joda-time-jsptags
- https://github.com/JodaOrg/joda-time-i18n
Other related projects:
Available as part of the Tidelift Subscription.
Joda and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.
If you want the flexibility of open source and the confidence of commercial-grade software, this is for you.
Please useStack Overflow for general usage questions.GitHubissues andpull requestsshould be used when you want to help advance the project.
Any donations to support the project are accepted viaOpenCollective.
To report a security vulnerability, please use theTidelift security contact.Tidelift will coordinate the fix and disclosure.
Joda-Time is developed using standardGitHub tools.Acheckstyle file is available, and PRs must comply with it.The project can be built usingApache Maven, such asmvn clean install
.Continuous Integration takes place usingGitHub Actions.Units tests are written inJUnit and run as part of the build and continuous integration.Changes via PR must include appropiate test coverage.
Note that Joda-Time is considered to be a largely “finished” project. No major enhancements are planned. If using Java SE 8, please migrate to java.time (JSR-310).
- 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=""
- Website will be built and released by GitHub Actions
If the GitHub stage fails, usemvn clean deploy -Doss.repo -DskipRemoteStaging=true
to re-run
About
Joda-Time is the widely used replacement for the Java date and time classes prior to Java SE 8.