Using JODA to deal with the time(2)User Guide
Introduction
Usage of the key DateTime, Interval, Duration and Period classes.
Architecture Overview
There are the concepts of instant, interval, period, duration, chronology and timezones.
Instants
The millisecond instant can be converted to any date time field.
Fields and Properties
The property class associated with DateTime is DateTime.Property.
Intervals
An interval in JODA-Time represents an interval of time from one instant to another instant.
Intervals are implemented as half-open, which is to say that the start instant is inclusive but the end instant is exclusive.
Durations
Durations have no chronology or time zone, and consist solely of the millisecond duration.
Periods
Periods are inexact in terms of milliseconds.
For example, 1 month is quite different in February.
Periods are implemented as a set of int fields. The standard set of fields in a period are years, months, weeks, days, hours, minutes, seconds and milliseconds.
Chronology
…snip…
TimeZones
var zoneUTC = DateTimeZone.UTC
println("DateTimeZone Object = " + zoneUTC)
Querying DateTimes
var iDow = dt.getDayOfWeek()
println(iDow) // 1=MONDAY, SUNDAY=7
var propertyDow = dt.dayOfWeek() //DateTime.Property
println(propertyDow.getAsShortText() + " " + propertyDow.getAsText())
Manipulating DateTimes
DateTime result = dt.plusDays(3);
And the API is here, look up the API when you use it.
http://joda-time.sourceforge.net/api-release/index.html
References:
http://sillycat.iteye.com/blog/1819572
http://joda-time.sourceforge.net/userguide.html
分享到:
相关推荐
joda-time api user guide
赠送jar包:joda-time-2.9.5.jar; 赠送原API文档:joda-time-2.9.5-javadoc.jar; 赠送源代码:joda-time-2.9.5-sources.jar; 赠送Maven依赖信息文件:joda-time-2.9.5.pom; 包含翻译后的API文档:joda-time-...
joda-time-2.1.jar
赠送jar包:joda-time-2.10.8.jar; 赠送原API文档:joda-time-2.10.8-javadoc.jar; 赠送源代码:joda-time-2.10.8-sources.jar; 赠送Maven依赖信息文件:joda-time-2.10.8.pom; 包含翻译后的API文档:joda-time-...
赠送jar包:joda-time-2.10.4.jar; 赠送原API文档:joda-time-2.10.4-javadoc.jar; 赠送源代码:joda-time-2.10.4-sources.jar; 赠送Maven依赖信息文件:joda-time-2.10.4.pom; 包含翻译后的API文档:joda-time-...
joda-time-2.9.9时间日期转换工具类,简单易用,功能强大!
Joda-Time提供了一组Java类包用于处理包括ISO8601标准在内的date和time。可以利用它把JDK Date和Calendar类完全替换掉,而且仍然能够提供很好的集成。 Joda-Time主要的特点包括: 1. 易于使用:Calendar让获取...
赠送jar包:joda-time-2.8.1.jar 赠送原API文档:joda-time-2.8.1-javadoc.jar 赠送源代码:joda-time-2.8.1-sources.jar 包含翻译后的API文档:joda-time-2.8.1-javadoc-API文档-中文(简体)版.zip 对应Maven信息...
Joda-Time提供了一组Java类包用于处理包括ISO8601标准在内的date和time。可以利用它把JDK Date和Calendar类完全替换掉,而且仍然能够提供很好的集成。 Joda-Time主要的特点包括: 1. 易于使用:Calendar让获取"正常...
赠送jar包:joda-time-2.2.jar; 赠送原API文档:joda-time-2.2-javadoc.jar; 赠送源代码:joda-time-2.2-sources.jar; 赠送Maven依赖信息文件:joda-time-2.2.pom; 包含翻译后的API文档:joda-time-2.2-javadoc-...
(JDK1.8的API已经重写了日期库,引入的java.time包,其实也是借鉴了Joda-Time) --------------------- 作者:--nodeps 来源:CSDN 原文:https://blog.csdn.net/backbug/article/details/78646152 版权声明:...
赠送jar包:joda-time-2.8.1.jar; 赠送原API文档:joda-time-2.8.1-javadoc.jar; 赠送源代码:joda-time-2.8.1-sources.jar; 赠送Maven依赖信息文件:joda-time-2.8.1.pom; 包含翻译后的API文档:joda-time-...
赠送jar包:joda-time-2.5.jar; 赠送原API文档:joda-time-2.5-javadoc.jar; 赠送源代码:joda-time-2.5-sources.jar; 赠送Maven依赖信息文件:joda-time-2.5.pom; 包含翻译后的API文档:joda-time-2.5-javadoc-...
赠送jar包:joda-time-2.9.9.jar; 赠送原API文档:joda-time-2.9.9-javadoc.jar; 赠送源代码:joda-time-2.9.9-sources.jar; 赠送Maven依赖信息文件:joda-time-2.9.9.pom; 包含翻译后的API文档:joda-time-...
Joda-Time是一个强大、易用、高效的日期和时间库,可以利用它把JDK Date和Calendar类完全替换掉无论是计算日期,打印日期、或者解析日期,都非常使用,便捷.附件中有最新的jar包,然后有对JodaTime详细的解释,以及...
joda-time
Joda-Time 令时间和日期值变得易于管理、操作和理解。日期和时间是一个非常复杂的领域。Joda-Time中的许多类旨在使域的细微差别得以充分表达。版本2.10.6是当前的最新版本。该版本被认为是稳定的,值得2.x标签使用。
joda-time-2.8.2.jar