`
sillycat
  • 浏览: 2486728 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Using JODA to deal with the time(2)User Guide

 
阅读更多
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 - Java date and time API - User Guide

    joda-time api user guide

    joda-time-2.9.5-API文档-中文版.zip

    赠送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

    joda-time-2.1.jar

    joda-time-2.10.8-API文档-中文版.zip

    赠送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-...

    joda-time-2.10.4-API文档-中文版.zip

    赠送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-2.9.9时间日期转换工具类,简单易用,功能强大!

    joda-time-2.3

    Joda-Time提供了一组Java类包用于处理包括ISO8601标准在内的date和time。可以利用它把JDK Date和Calendar类完全替换掉,而且仍然能够提供很好的集成。 Joda-Time主要的特点包括: 1. 易于使用:Calendar让获取...

    joda-time-2.8.1-API文档-中文版.zip

    赠送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 工具

    Joda-Time提供了一组Java类包用于处理包括ISO8601标准在内的date和time。可以利用它把JDK Date和Calendar类完全替换掉,而且仍然能够提供很好的集成。 Joda-Time主要的特点包括: 1. 易于使用:Calendar让获取"正常...

    joda-time-2.2-API文档-中英对照版.zip

    赠送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-...

    joda-time2.10.1

    (JDK1.8的API已经重写了日期库,引入的java.time包,其实也是借鉴了Joda-Time) --------------------- 作者:--nodeps 来源:CSDN 原文:https://blog.csdn.net/backbug/article/details/78646152 版权声明:...

    joda-time-2.8.1-API文档-中英对照版.zip

    赠送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-...

    joda-time-2.5-API文档-中文版.zip

    赠送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-...

    joda-time-2.9.9-API文档-中英对照版.zip

    赠送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 jar包及详细笔记

    Joda-Time是一个强大、易用、高效的日期和时间库,可以利用它把JDK Date和Calendar类完全替换掉无论是计算日期,打印日期、或者解析日期,都非常使用,便捷.附件中有最新的jar包,然后有对JodaTime详细的解释,以及...

    joda-time-2.9.9-dist.tar.gz

    joda-time

    joda-time-2.8.2.jar

    joda-time-2.8.2.jar

    joda-time源码

    joda-time源码,在日常的编程中,常常需要处理日期。但是使用 java.util.Calendar 类处理日期/时间,非常的麻烦。那么福音来了,博主给大家隆重的介绍一款新的类库Joda-Time!并且,已经将其封装成一个“日期处理...

Global site tag (gtag.js) - Google Analytics