org.joda.time

Interface ReadableDateTime

All Superinterfaces:
Comparable, ReadableInstant
Known Subinterfaces:
ReadWritableDateTime
Known Implementing Classes:
AbstractDateTime, BaseDateTime, DateMidnight, DateTime, MutableDateTime

public interface ReadableDateTime
extends ReadableInstant

Defines an instant in time that can be queried using datetime fields.

The implementation of this interface may be mutable or immutable. This interface only gives access to retrieve data, never to change it.

Methods in your application should be defined using ReadableDateTime as a parameter if the method only wants to read the datetime, and not perform any advanced manipulations.

Authors:
Stephen Colebourne
Brian S O'Neill
Since:
1.0

Method Summary

int
getCenturyOfEra()
Get the year of era field value.
int
getDayOfMonth()
Get the day of month field value.
int
getDayOfWeek()
Get the day of week field value.
int
getDayOfYear()
Get the day of year field value.
int
getEra()
Get the era field value.
int
getHourOfDay()
Get the hour of day field value.
int
getMillisOfDay()
Get the millis of day field value.
int
getMillisOfSecond()
Get the millis of second field value.
int
getMinuteOfDay()
Get the minute of day field value.
int
getMinuteOfHour()
Get the minute of hour field value.
int
getMonthOfYear()
Get the month of year field value.
int
getSecondOfDay()
Get the second of day field value.
int
getSecondOfMinute()
Get the second of minute field value.
int
getWeekOfWeekyear()
Get the week of weekyear field value.
int
getWeekyear()
Get the weekyear field value.
int
getYear()
Get the year field value.
int
getYearOfCentury()
Get the year of century field value.
int
getYearOfEra()
Get the year of era field value.
DateTime
toDateTime()
Get this object as a DateTime.
MutableDateTime
toMutableDateTime()
Get this object as a MutableDateTime, always returning a new instance.
String
toString(String pattern)
Output the instant using the specified format pattern.
String
toString(String pattern, Locale locale)
Output the instant using the specified format pattern.

Methods inherited from interface org.joda.time.ReadableInstant

compareTo, equals, get, getChronology, getMillis, getZone, hashCode, isAfter, isBefore, isEqual, isSupported, toInstant, toString

Method Details

getCenturyOfEra

public int getCenturyOfEra()
Get the year of era field value.
Returns:
the year of era

getDayOfMonth

public int getDayOfMonth()
Get the day of month field value.
Returns:
the day of month

getDayOfWeek

public int getDayOfWeek()
Returns:
the day of week

getDayOfYear

public int getDayOfYear()
Get the day of year field value.
Returns:
the day of year

getEra

public int getEra()
Get the era field value.
Returns:
the era

getHourOfDay

public int getHourOfDay()
Get the hour of day field value.
Returns:
the hour of day

getMillisOfDay

public int getMillisOfDay()
Get the millis of day field value.
Returns:
the millis of day

getMillisOfSecond

public int getMillisOfSecond()
Get the millis of second field value.
Returns:
the millis of second

getMinuteOfDay

public int getMinuteOfDay()
Get the minute of day field value.
Returns:
the minute of day

getMinuteOfHour

public int getMinuteOfHour()
Get the minute of hour field value.
Returns:
the minute of hour

getMonthOfYear

public int getMonthOfYear()
Get the month of year field value.
Returns:
the month of year

getSecondOfDay

public int getSecondOfDay()
Get the second of day field value.
Returns:
the second of day

getSecondOfMinute

public int getSecondOfMinute()
Get the second of minute field value.
Returns:
the second of minute

getWeekOfWeekyear

public int getWeekOfWeekyear()
Get the week of weekyear field value.
Returns:
the week of a week based year

getWeekyear

public int getWeekyear()
Get the weekyear field value.
Returns:
the year of a week based year

getYear

public int getYear()
Get the year field value.
Returns:
the year

getYearOfCentury

public int getYearOfCentury()
Get the year of century field value.
Returns:
the year of century

getYearOfEra

public int getYearOfEra()
Get the year of era field value.
Returns:
the year of era

toDateTime

public DateTime toDateTime()
Get this object as a DateTime.

If the implementation of the interface is a DateTime, it is returned directly.

Returns:
a DateTime using the same millis

toMutableDateTime

public MutableDateTime toMutableDateTime()
Get this object as a MutableDateTime, always returning a new instance.
Returns:
a MutableDateTime using the same millis

toString

public String toString(String pattern)
            throws IllegalArgumentException
Output the instant using the specified format pattern.
Parameters:
pattern - pattern specification

toString

public String toString(String pattern,
                       Locale locale)
            throws IllegalArgumentException
Output the instant using the specified format pattern.
Parameters:
pattern - pattern specification
locale - Locale to use, or null for default

Copyright (c) 2001-2006 - Joda.org