|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.calendar.CalendarUtils
public final class CalendarUtils
methods that require a calendar for calculation are synchronized, so they do not perform simultaneously
| Field Summary | |
|---|---|
static SimpleDateFormat |
ietfDateFormat
the IETF date format is used in HTTP headers for displaying the date. |
| Method Summary | |
|---|---|
static int |
age(Date birthday)
|
static Comparator<Date> |
createBirthdayComparator()
returns a newly created comparator that will compare the dates by ignoring the year |
static Date |
dayBegin(Date d)
returns a date that is set to the begin of the given day (daytime 12:00 a.m.) |
static int |
dayOfWeek(Date date)
|
static Date |
monthBegin(Date d)
|
static Date |
nextDay(Date d)
returns a date that is exactly a day later |
static Date |
nextMonth(Date d)
returns a date that is exactly a month later |
static Date |
nextWeek(Date d)
returns a date that is exactly a week later |
static Date |
nextYear(Date d)
returns a date that is exactly a year later |
static int |
offset(Date date)
returns the offset that must be adjusted due to timezone specific daylight saving times |
static boolean |
sameDay(Date d1,
Date d2)
returns true only if the two dates are within the same day |
static void |
setCalendar(Calendar calendar)
by default, the standard GregorianCalendar is used |
static int |
timeInDay(Date date)
returns milliseconds from the beginning of the day |
static Date |
weekBegin(Date d)
|
static Date |
yearBegin(Date d)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final SimpleDateFormat ietfDateFormat
java.util.Date.parse(String),
this offers an easy way to make the IETF date format work in any
non-deprecated API.
| Method Detail |
|---|
public static void setCalendar(Calendar calendar)
public static int dayOfWeek(Date date)
Calendar.DAY_OF_WEEKpublic static int timeInDay(Date date)
public static int offset(Date date)
public static boolean sameDay(Date d1,
Date d2)
public static Date dayBegin(Date d)
public static Date weekBegin(Date d)
public static Date monthBegin(Date d)
public static Date yearBegin(Date d)
public static Date nextDay(Date d)
public static Date nextWeek(Date d)
public static Date nextMonth(Date d)
public static Date nextYear(Date d)
public static int age(Date birthday)
public static Comparator<Date> createBirthdayComparator()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||