@Immutable public class CalendarDate extends Object implements Comparable<CalendarDate>
| Modifier and Type | Method and Description |
|---|---|
CalendarDate |
add(CalendarPeriod period) |
CalendarDate |
add(double value,
CalendarPeriod.Field unit) |
int |
compareTo(CalendarDate o) |
boolean |
equals(Object o) |
Calendar |
getCalendar() |
long |
getDifferenceInMsecs(CalendarDate o)
Get difference between two calendar dates in millisecs
|
int |
getHourOfDay()
Get the hour of day (0-23) field for this chronology.
|
int |
hashCode() |
boolean |
isAfter(CalendarDate o) |
boolean |
isBefore(CalendarDate o) |
static void |
main(String[] args) |
static CalendarDate |
of(Calendar cal,
int year,
int monthOfYear,
int dayOfMonth,
int hourOfDay,
int minuteOfHour,
int secondOfMinute) |
static CalendarDate |
of(Date date)
Create CalendarDate from a java.util.Date
|
static CalendarDate |
of(long msecs)
Create CalendarDate from msecs since epoch
|
static CalendarDate |
parseISOformat(String calendarName,
String isoDateString)
Get CalendarDate from ISO date string
|
static CalendarDate |
parseUdunits(String calendarName,
String udunits)
Get CalendarDate from udunit date string
|
static CalendarDate |
present()
Get a CalendarDate representing the present moment
|
CalendarDate |
subtract(CalendarPeriod period) |
Date |
toDate() |
String |
toString()
ISO formatted string
|
static CalendarDate |
withDoy(Calendar cal,
int year,
int doy,
int hourOfDay,
int minuteOfHour,
int secondOfMinute) |
public static CalendarDate present()
public static CalendarDate of(Calendar cal, int year, int monthOfYear, int dayOfMonth, int hourOfDay, int minuteOfHour, int secondOfMinute)
cal - calendar to use, or null for defaultyear - any integermonthOfYear - 1-12dayOfMonth - 1-31hourOfDay - 0-23minuteOfHour - 0-59secondOfMinute - 0-59public static CalendarDate withDoy(Calendar cal, int year, int doy, int hourOfDay, int minuteOfHour, int secondOfMinute)
public static CalendarDate of(Date date)
date - java.util.Datepublic static CalendarDate of(long msecs)
msecs - milliseconds from 1970-01-01T00:00:00Zpublic static CalendarDate parseISOformat(String calendarName, String isoDateString)
calendarName - get Calendar from Calendar.get(calendarName). may be nullisoDateString - ISO date stringpublic static CalendarDate parseUdunits(String calendarName, String udunits)
calendarName - get Calendar from Calendar.get(calendarName). may be nulludunits - must be value (space) udunits stringpublic Calendar getCalendar()
public int compareTo(CalendarDate o)
compareTo in interface Comparable<CalendarDate>public boolean isAfter(CalendarDate o)
public boolean isBefore(CalendarDate o)
public String toString()
public int getHourOfDay()
public CalendarDate add(double value, CalendarPeriod.Field unit)
public CalendarDate add(CalendarPeriod period)
public CalendarDate subtract(CalendarPeriod period)
public Date toDate()
public long getDifferenceInMsecs(CalendarDate o)
o - other calendar datepublic static void main(String[] args)
Copyright © 1999-2012 UCAR/Unidata. All Rights Reserved.