|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.knowledgeplaza.util.CalendarUtil
public class CalendarUtil
Quick format and quick parse (ISO) for Calendars
| Field Summary | |
|---|---|
static long |
EPOCH_UNIX_ERA_DAY
Value to add to the day number returned by this calendar to find the Julian Day number. |
protected static long |
MILLISECS_PER_DAY
Number of leap seconds per day expect on 1. |
static long |
MILLISECS_PER_HOUR
Number of milliseconds per hour, except when a leap second is inserted. |
static long |
MILLISECS_PER_MINUTE
All minutes have this many milliseconds except the last minute of the day on a day defined with a leap second. |
static String |
SOURCECODE_VERSION
Standard variable for determining version of a class file. |
| Constructor Summary | |
|---|---|
CalendarUtil()
|
|
| Method Summary | |
|---|---|
static Calendar |
clearDate(Calendar c)
Clear date (date becomes 1-1-1) |
static Calendar |
clearTime(Calendar c)
Clear time |
static Calendar |
copyDate(Calendar from,
Calendar to)
copies the date fields from the first into the second parameter |
static Calendar |
copyTime(Calendar from,
Calendar to)
copies the time fields from the first into the second parameter |
static boolean |
dateAfter(Calendar c1,
Calendar c2)
does the date (ignoring time) fall after |
static boolean |
dateAfterOrEqual(Calendar c1,
Calendar c2)
does the date (ignoring time) fall after or is equal to |
static boolean |
dateBefore(Calendar c1,
Calendar c2)
does the date (ignoring time) fall before |
static boolean |
dateBeforeOrEqual(Calendar c1,
Calendar c2)
does the date (ignoring time) fall before or is equal to |
static long |
distanceInDays(Calendar c1,
Calendar c2)
Difference between two dates in days |
static long |
distanceInMilliseconds(Calendar c1,
Calendar c2)
Difference between two dates in milliseconds |
static String |
filePrefix()
|
static String |
filePrefix(Calendar calendar)
create a date-time file prefix |
static String |
filePrefixLong()
|
static String |
filePrefixLong(Calendar calendar)
create a date-time file prefix including milliseconds |
static String |
getDateSeparator()
Return the date separator, e.g. |
static String |
getDateSeparator(Locale locale)
Return the date separator, e.g. |
static long |
getJulianDay(Calendar c)
|
static long |
getUnixDay(Calendar c)
|
static Calendar |
gotoFirstDateOfHalfyear(Calendar c)
Move the provided calendar to the first date Make sure to provide a clone if you don't want to provided calendar to be altered. |
static Calendar |
gotoFirstDateOfLastFewMonths(Calendar c,
int months)
Move the provided calendar to the first date Make sure to provide a clone if you don't want to provided calendar to be altered. |
static Calendar |
gotoFirstDateOfMonth(Calendar c)
Move the provided calendar to the first date Make sure to provide a clone if you don't want to provided calendar to be altered. |
static Calendar |
gotoFirstDateOfQuarter(Calendar c)
Move the provided calendar to the first date Make sure to provide a clone if you don't want to provided calendar to be altered. |
static Calendar |
gotoFirstDateOfWeek(Calendar c)
Move the provided calendar to the first date of the week. |
static Calendar |
gotoFirstDateOfYear(Calendar c)
Move the provided calendar to the first date Make sure to provide a clone if you don't want to provided calendar to be altered. |
static Calendar |
gotoLastDateOfHalfyear(Calendar c)
Move the provided calendar to the last date Make sure to provide a clone if you don't want to provided calendar to be altered. |
static Calendar |
gotoLastDateOfLastFewMonths(Calendar c,
int months)
Move the provided calendar to the last date, Make sure to provide a clone if you don't want to provided calendar to be altered. |
static Calendar |
gotoLastDateOfMonth(Calendar c)
Move the provided calendar to the last date Make sure to provide a clone if you don't want to provided calendar to be altered. |
static Calendar |
gotoLastDateOfQuarter(Calendar c)
Move the provided calendar to the last date Make sure to provide a clone if you don't want to provided calendar to be altered. |
static Calendar |
gotoLastDateOfWeek(Calendar c)
Move the provided calendar to the last date of the week. |
static Calendar |
gotoLastDateOfYear(Calendar c)
Move the provided calendar to the last date Make sure to provide a clone if you don't want to provided calendar to be altered. |
static boolean |
isSameDate(Calendar c1,
Calendar c2)
See if two dates are on the same date (ignoring the time) |
static boolean |
isSameMonth(Calendar c1,
Calendar c2)
See if two dates are on the same month (ignoring the time and day) |
static boolean |
isSameTimeHMS(Calendar c1,
Calendar c2)
See if two dates are on the same time (ignoring the date and milliseconds) |
static boolean |
isSameTimeHMSM(Calendar c1,
Calendar c2)
See if two dates are on the same time (ignoring the date, but including milliseconds) |
static boolean |
isSameYear(Calendar c1,
Calendar c2)
See if two dates are in the same year (ignoring the time, day and month) |
static String |
quickFormatCalendar(Calendar calendar)
small utility method to format a calendar for logging according to YYYY-MM-DD [hh:mm:ss] |
static String |
quickFormatCalendarDate(Calendar calendar)
small utility method to format a calendar for logging according to YYYY-MM-DD |
static String |
quickFormatCalendarDateTime(Calendar calendar)
small utility method to format a calendar for logging according to YYYY-MM-DD hh:mm:ss |
static String |
quickFormatCalendarTime(Calendar pCalendar)
small utility method to format a calendar for logging according to hh:mm:ss |
static GregorianCalendar |
quickParseGregorianCalendar(String value)
small utility method to format a calendar for logging according to YYYY-MM-DD |
static GregorianCalendar |
quickParseGregorianCalendarDate(String value)
small utility method to format a calendar for logging according to YYYY-MM-DD |
static GregorianCalendar |
quickParseGregorianCalendarFull(String value)
small utility method to format a calendar for logging according to YYYY-MM-DD |
static GregorianCalendar |
quickParseGregorianCalendarTime(String value)
small utility method to format a calendar for logging according to YYYY-MM-DD |
static Calendar |
setFromMilliseconds(Calendar calendar,
long value)
Set calendar from milliseconds |
static Calendar |
setTimeToJustBeforeMidnight(Calendar c)
23:59:59.999 |
static Calendar |
setTimeToMidnight(Calendar c)
00:00:00.000 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String SOURCECODE_VERSION
public static final long MILLISECS_PER_MINUTE
public static final long MILLISECS_PER_HOUR
protected static final long MILLISECS_PER_DAY
public static final long EPOCH_UNIX_ERA_DAY
http://www.hermetic.ch/cal_stud/jdn.htm,
Constant Field Values| Constructor Detail |
|---|
public CalendarUtil()
| Method Detail |
|---|
public static String quickFormatCalendar(Calendar calendar)
calendar - the calendar
public static String quickFormatCalendarDateTime(Calendar calendar)
calendar - the calendar
public static String quickFormatCalendarDate(Calendar calendar)
calendar - the calendar
public static String quickFormatCalendarTime(Calendar pCalendar)
pCalendar - the calendar
public static GregorianCalendar quickParseGregorianCalendar(String value)
pCalendar - the calendar
public static GregorianCalendar quickParseGregorianCalendarFull(String value)
pCalendar - the calendar
public static GregorianCalendar quickParseGregorianCalendarDate(String value)
pCalendar - the calendar
public static GregorianCalendar quickParseGregorianCalendarTime(String value)
pCalendar - the calendar
public static Calendar gotoFirstDateOfWeek(Calendar c)
c - public static Calendar gotoLastDateOfWeek(Calendar c)
c - public static Calendar gotoFirstDateOfMonth(Calendar c)
c - public static Calendar gotoLastDateOfMonth(Calendar c)
c -
public static Calendar gotoFirstDateOfLastFewMonths(Calendar c,
int months)
c -
public static Calendar gotoLastDateOfLastFewMonths(Calendar c,
int months)
c - public static Calendar gotoFirstDateOfQuarter(Calendar c)
c - public static Calendar gotoLastDateOfQuarter(Calendar c)
c - public static Calendar gotoFirstDateOfHalfyear(Calendar c)
c - public static Calendar gotoLastDateOfHalfyear(Calendar c)
c - public static Calendar gotoFirstDateOfYear(Calendar c)
c - public static Calendar gotoLastDateOfYear(Calendar c)
c - public static Calendar clearDate(Calendar c)
c - public static Calendar clearTime(Calendar c)
c - public static Calendar setTimeToMidnight(Calendar c)
c - public static Calendar setTimeToJustBeforeMidnight(Calendar c)
c -
public static Calendar copyDate(Calendar from,
Calendar to)
c -
public static Calendar copyTime(Calendar from,
Calendar to)
c -
public static boolean isSameDate(Calendar c1,
Calendar c2)
c1 - c2 -
public static boolean isSameMonth(Calendar c1,
Calendar c2)
c1 - c2 -
public static boolean isSameYear(Calendar c1,
Calendar c2)
c1 - c2 -
public static boolean isSameTimeHMS(Calendar c1,
Calendar c2)
c1 - c2 -
public static boolean isSameTimeHMSM(Calendar c1,
Calendar c2)
c1 - c2 -
public static String getDateSeparator()
public static String getDateSeparator(Locale locale)
locale -
public static long distanceInDays(Calendar c1,
Calendar c2)
c1 - c2 -
public static long distanceInMilliseconds(Calendar c1,
Calendar c2)
c1 - c2 -
public static Calendar setFromMilliseconds(Calendar calendar,
long value)
value - public static long getUnixDay(Calendar c)
public static long getJulianDay(Calendar c)
for more information about local C-JDNpublic static String filePrefix(Calendar calendar)
calendar - the calendar
public static String filePrefix()
public static String filePrefixLong(Calendar calendar)
calendar - the calendar
public static String filePrefixLong()
public static boolean dateBefore(Calendar c1,
Calendar c2)
public static boolean dateBeforeOrEqual(Calendar c1,
Calendar c2)
public static boolean dateAfter(Calendar c1,
Calendar c2)
public static boolean dateAfterOrEqual(Calendar c1,
Calendar c2)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||