Tree [8c85bc] master HEAD /
History



File Date Author Commit
nbproject 2012-04-30 Benjamin Graf Benjamin Graf [702b35] Add standard source to core test to solve missi...
src 2012-06-16 Stephen Colebourne Stephen Colebourne [678685] Merge date and time fields/units
src-extra 2012-06-16 Stephen Colebourne Stephen Colebourne [678685] Merge date and time fields/units
src-openjdk 2012-05-25 Stephen Colebourne Stephen Colebourne [ac482f] Initial checkin of approach to use single with ...
src-standard 2012-06-20 Stephen Colebourne Stephen Colebourne [1bf4c9] Start to implement non-standard field using new...
survey 2012-05-24 Stephen Colebourne Stephen Colebourne [8c85bc] Additional survey results
.checkstyle 2010-12-24 Stephen Colebourne Stephen Colebourne [9fafaf] Separate code from JSR
.classpath 2012-04-23 Stephen Colebourne Stephen Colebourne [eeb424] Remove unused source folders
.gitignore 2011-06-24 Stephen Colebourne Stephen Colebourne [980371] Git ignore
.project 2010-12-24 Stephen Colebourne Stephen Colebourne [9fafaf] Separate code from JSR
COPYRIGHT-ASSIGN.txt 2011-06-28 Stephen Colebourne Stephen Colebourne [856016] Update mailing list and contribution in the CLA
LICENSE.txt 2010-01-07 Stephen Colebourne Stephen Colebourne [067bba] Update copyright date to 2010
LICENSE_OpenJDK.txt 2009-06-11 Stephen Colebourne Stephen Colebourne [30426f] Clarify licenses
OpenJDKChallenge.txt 2008-08-04 Stephen Colebourne Stephen Colebourne [1cc5d0] Add more URIs
README.txt 2011-10-20 Richard Warburton Richard Warburton [a9bc36] adds a tck acceptance target that runs a test s...
RELEASE-NOTES.txt 2012-02-18 Stephen Colebourne Stephen Colebourne [84c739] Update notes
TODO.txt 2012-02-18 Stephen Colebourne Stephen Colebourne [84c739] Update notes
build.properties 2012-04-23 Stephen Colebourne Stephen Colebourne [eeb424] Remove unused source folders
build.xml 2012-06-07 Roger Riggs Roger Riggs [f6c4f9] Applied CalendricalObject.with changes to DateT...
checkstyle.xml 2012-04-26 Stephen Colebourne Stephen Colebourne [b9374b] Adjust checkstyle
suppressions.xml 2010-12-25 Stephen Colebourne Stephen Colebourne [4e5cfc] Checkstyle
threeten.iml 2010-12-24 Stephen Colebourne Stephen Colebourne [9fafaf] Separate code from JSR
user.dic 2010-09-02 Stephen Colebourne Stephen Colebourne [2b78e0] Spelling

Read Me

ThreeTen
========
ThreeTen provides a modern date and time library for Java.
It is the reference implementation for JSR-310.

See the home page for more details and downloads:
Home page and downloads are at Sourceforge.
http://threeten.sourceforge.net/
http://sourceforge.net/projects/threeten/

The source code is held primarily at GitHub:
https://github.com/ThreeTen/threeten

Geting started
--------------
The main build process uses Apache Ant - http://ant.apache.org
From the command line the following options will get you started:
  ant                 # downloads libraries and compiles code to a jar file
  ant examples        # runs a supplied java program to print some examples
  ant javadoc         # creates the javadoc
  ant test            # runs the main test suite (excluding OpenJDK classes)
  ant tck             # runs the tck acceptance test. NB: you must use the -Dtck.implementation parameter in order to specify the jar under test
  ant coverage        # calculates test coverage (excluding OpenJDK classes)
Oracle JDK 1.6 (or OpenJDK) is required to build the codebase.


Basic user guide
----------------
ThreeTen divides time into two categories - continuous and human.

Continuous time is based around a single incrementing number from a single epoch.
ThreeTen counts in nanoseconds from 1970-01-01T00:00:00.000000000Z
Continuous time is represented as follows:
 - Instant - a point on the time-line to nanosecond precision
 - Duration - an amount of time measured in nanoseconds

Human time is based around fields, such as year, month, day and hour.
ThreeTen supports precision of nanoseconds.
The year range roughly equal to the range of a 32-bit int.
Human time is represented via a group of classes:
 - LocalDate - a date, without time of day, offset or zone
 - LocalTime - the time of day, without date, offset or zone
 - LocalDateTime - the date and time, without offset or zone
 - OffsetDate - a date with an offset such as +02:00, without time of day or zone
 - OffsetTime - the time of day with an offset such as +02:00, without date or zone
 - OffsetDateTime - the date and time with an offset such as +02:00, without a zone
 - ZonedDateTime - the date and time with a time zone and offset
 - YearMonth - a year and month
 - MonthDay - month and day
 - Year/MonthOfDay/DayOfWeek/... - classes for the important fields
 - DateTimeFields - stores a map of field-value pairs which may be invalid
 - Calendrical - access to the low-level API
 - Period - a descriptive amount of time, such as "2 months and 3 days"

Support classes include:
 - Clock - wraps the current date and time
 - ZoneOffset - the offset from UTC, such as -05:00
 - ZoneId - the time zone, such as Europe/London
 - Numerous small interfaces - these link the main classes together

Additional packages provide for:
 - formatting and parsing
 - alternate calendar systems
 - single field periods
 - integration with existing Java classes


Status
------
The ThreeTen project is used to drive the reference implementation of JSR-310.
The API is currently considered usable and accurate, yet incomplete and subject to change.
If you use this API you must be able to handle incompatible changes in later versions.

Special efforts with the boot classpath are necessary to test and use
the integration with the existing Java classes.

Test coverage is high and all current tests pass.

Feedback is welcomed!
Home page: http://threeten.sourceforge.net/
Mailing list: http://sourceforge.net/mailarchive/forum.php?forum_name=threeten-develop (develop)

ThreeTen/JSR-310 team


(See the license files for detail on licensing, warranty and disclaimers)
(All trademarks are hereby granted to their respective owners)

/*
 * Copyright (c) 2008, Stephen Colebourne & Michael Nascimento Santos
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *  * Redistributions of source code must retain the above copyright notice,
 *    this list of conditions and the following disclaimer.
 *
 *  * Redistributions in binary form must reproduce the above copyright notice,
 *    this list of conditions and the following disclaimer in the documentation
 *    and/or other materials provided with the distribution.
 *
 *  * Neither the name of JSR-310 nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */