Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Joda-Time is the widely used replacement for the Java date and time classes prior to Java SE 8.

License

NotificationsYou must be signed in to change notification settings

JodaOrg/joda-time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

Tidelift dependency checkCII Best Practices

Documentation

Various documentation is available:

Releases

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

Related projects at GitHub:

Other related projects:

For enterprise

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.

Learn more

Support

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.

Development and Contributions

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).

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=""
  • Website will be built and released by GitHub Actions

If the GitHub stage fails, usemvn clean deploy -Doss.repo -DskipRemoteStaging=true to re-run


[8]ページ先頭

©2009-2025 Movatter.jp