Joda-Time 2.5

Joda-Time 2.5

测试测试过的
语言语言 Objective-C Objective-C
许可证 Apache 2
发布最新发布2015年3月

Michael VoongNick Williams 维护。



  • 作者:
  • Michael Voong

Joda-Time提供了Java日期和时间的优质替代品。其设计允许使用多个日历系统,同时仍提供简单的API。'默认'日历是ISO8601标准,该标准由XML使用。还包括格里高利、儒略、佛教、科普特、埃塞俄比亚和伊斯兰教体系,并且我们欢迎进一步的添加。支持的类包括时区、持续时间、格式和解析。

作为Joda-Time的一个例子,这里有一些示例代码

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在友好商业的Apache 2.0许可证之下发布。

文档

各种文档可供参考

发行版

2.5发行版是当前最新的发行版。这个版本被认为是稳定的,并且值得1.x标签。它依赖于JDK 1.5或更高版本。

可在Maven中央仓库中找到

相关项目

GitHub上的相关项目

其他相关项目

支持

请使用GitHub问题跟踪器和拉取请求进行支持。

历史

问题跟踪和活跃开发位于GitHub。历史上,该项目位于Sourceforge