GithubHelp home page GithubHelp logo

ajrulez / joda-time Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jodaorg/joda-time

0.0 1.0 0.0 10.77 MB

Joda-Time is the widely used replacement for the Java date and time classes.

Home Page: http://www.joda.org/joda-time/

License: Apache License 2.0

Java 99.70% HTML 0.29% CSS 0.02%

joda-time's Introduction

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, and we welcome further additions. Supporting classes include time zone, duration, format and parsing.

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

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

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.

joda-time's People

Contributors

jodastephen avatar broneill avatar mebigfatguy avatar codingfabian avatar gswierczynski avatar bjoernpollex avatar emopers avatar dancavallaro avatar pitel avatar haguenau avatar nyrk avatar dspitfire avatar strilanc avatar vrozkovec avatar amlingpalantir avatar kivancsunkar avatar kwangbkim avatar longhua avatar plumpy avatar oby1 avatar renniepet avatar rok-piltaver avatar rowanhill avatar tiembo avatar seva-ask avatar twillouer avatar dancojocar avatar jishi9 avatar mjunginger avatar tkawachi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.