|
||||||||||
| 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. days when a leap second has been inserted, e.g. 1999 JAN 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 java.lang.String |
SOURCECODE_VERSION
Standard variable for determining version of a class file. |
| Constructor Summary | |
|---|---|
CalendarUtil()
|
|
| Method Summary | |
|---|---|
static java.util.Calendar |
clearDate(java.util.Calendar c)
Clear date (date becomes 1-1-1) |
static java.util.Calendar |
clearTime(java.util.Calendar c)
Clear time |
static java.util.Calendar |
copyDate(java.util.Calendar from,
java.util.Calendar to)
copies the date fields from the first into the second parameter |
static java.util.Calendar |
copyTime(java.util.Calendar from,
java.util.Calendar to)
copies the time fields from the first into the second parameter |
static long |
distanceInDays(java.util.Calendar c1,
java.util.Calendar c2)
Difference between two dates in days |
static long |
distanceInMilliseconds(java.util.Calendar c1,
java.util.Calendar c2)
Difference between two dates in milliseconds |
static java.lang.String |
filePrefix()
|
static java.lang.String |
filePrefix(java.util.Calendar calendar)
create a date-time file prefix |
static java.lang.String |
filePrefixLong()
|
static java.lang.String |
filePrefixLong(java.util.Calendar calendar)
create a date-time file prefix including milliseconds |
static java.lang.String |
getDateSeparator()
Return the date separator, e.g. - for Dutch, . for German |
static java.lang.String |
getDateSeparator(java.util.Locale locale)
Return the date separator, e.g. - for Dutch, . for German |
static long |
getJulianDay(java.util.Calendar c)
|
static long |
getUnixDay(java.util.Calendar c)
|
static java.util.Calendar |
gotoFirstDateOfHalfyear(java.util.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 java.util.Calendar |
gotoFirstDateOfLastFewMonths(java.util.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 java.util.Calendar |
gotoFirstDateOfMonth(java.util.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 java.util.Calendar |
gotoFirstDateOfQuarter(java.util.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 java.util.Calendar |
gotoFirstDateOfWeek(java.util.Calendar c)
Move the provided calendar to the first date of the week. |
static java.util.Calendar |
gotoFirstDateOfYear(java.util.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 java.util.Calendar |
gotoLastDateOfHalfyear(java.util.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 java.util.Calendar |
gotoLastDateOfLastFewMonths(java.util.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 java.util.Calendar |
gotoLastDateOfMonth(java.util.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 java.util.Calendar |
gotoLastDateOfQuarter(java.util.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 java.util.Calendar |
gotoLastDateOfWeek(java.util.Calendar c)
Move the provided calendar to the last date of the week. |
static java.util.Calendar |
gotoLastDateOfYear(java.util.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(java.util.Calendar c1,
java.util.Calendar c2)
See if two dates are on the same date (ignoring the time) |
static boolean |
isSameTimeHMS(java.util.Calendar c1,
java.util.Calendar c2)
See if two dates are on the same time (ignoring the date) for hour, minute and second |
static boolean |
isSameTimeHMSM(java.util.Calendar c1,
java.util.Calendar c2)
See if two dates are on the same time (ignoring the date) for hour, minute, second and millesecond |
static java.lang.String |
quickFormatCalendar(java.util.Calendar calendar)
small utility method to format a calendar for logging according to YYYY-MM-DD |
static java.lang.String |
quickFormatCalendarDate(java.util.Calendar calendar)
small utility method to format a calendar for logging according to YYYY-MM-DD |
static java.lang.String |
quickFormatCalendarTime(java.util.Calendar pCalendar)
small utility method to format a calendar for logging according to YYYY-MM-DD |
static java.util.GregorianCalendar |
quickParseGregorianCalendar(java.lang.String value)
small utility method to format a calendar for logging according to YYYY-MM-DD |
static java.util.GregorianCalendar |
quickParseGregorianCalendarDate(java.lang.String value)
small utility method to format a calendar for logging according to YYYY-MM-DD |
static java.util.GregorianCalendar |
quickParseGregorianCalendarFull(java.lang.String value)
small utility method to format a calendar for logging according to YYYY-MM-DD |
static java.util.GregorianCalendar |
quickParseGregorianCalendarTime(java.lang.String value)
small utility method to format a calendar for logging according to YYYY-MM-DD |
static java.util.Calendar |
setFromMilliseconds(java.util.Calendar calendar,
long value)
Set calendar from milliseconds |
static java.util.Calendar |
setTimeToJustBeforeMidnight(java.util.Calendar c)
23:59:59.999 |
static java.util.Calendar |
setTimeToMidnight(java.util.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 java.lang.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 java.lang.String quickFormatCalendar(java.util.Calendar calendar)
calendar - the calendar
public static java.lang.String quickFormatCalendarDate(java.util.Calendar calendar)
calendar - the calendar
public static java.lang.String quickFormatCalendarTime(java.util.Calendar pCalendar)
pCalendar - the calendar
public static java.util.GregorianCalendar quickParseGregorianCalendar(java.lang.String value)
pCalendar - the calendar
public static java.util.GregorianCalendar quickParseGregorianCalendarFull(java.lang.String value)
pCalendar - the calendar
public static java.util.GregorianCalendar quickParseGregorianCalendarDate(java.lang.String value)
pCalendar - the calendar
public static java.util.GregorianCalendar quickParseGregorianCalendarTime(java.lang.String value)
pCalendar - the calendar
public static java.util.Calendar gotoFirstDateOfWeek(java.util.Calendar c)
c - public static java.util.Calendar gotoLastDateOfWeek(java.util.Calendar c)
c - public static java.util.Calendar gotoFirstDateOfMonth(java.util.Calendar c)
c - public static java.util.Calendar gotoLastDateOfMonth(java.util.Calendar c)
c -
public static java.util.Calendar gotoFirstDateOfLastFewMonths(java.util.Calendar c,
int months)
c -
public static java.util.Calendar gotoLastDateOfLastFewMonths(java.util.Calendar c,
int months)
c - public static java.util.Calendar gotoFirstDateOfQuarter(java.util.Calendar c)
c - public static java.util.Calendar gotoLastDateOfQuarter(java.util.Calendar c)
c - public static java.util.Calendar gotoFirstDateOfHalfyear(java.util.Calendar c)
c - public static java.util.Calendar gotoLastDateOfHalfyear(java.util.Calendar c)
c - public static java.util.Calendar gotoFirstDateOfYear(java.util.Calendar c)
c - public static java.util.Calendar gotoLastDateOfYear(java.util.Calendar c)
c - public static java.util.Calendar clearDate(java.util.Calendar c)
c - public static java.util.Calendar clearTime(java.util.Calendar c)
c - public static java.util.Calendar setTimeToMidnight(java.util.Calendar c)
c - public static java.util.Calendar setTimeToJustBeforeMidnight(java.util.Calendar c)
c -
public static java.util.Calendar copyDate(java.util.Calendar from,
java.util.Calendar to)
c -
public static java.util.Calendar copyTime(java.util.Calendar from,
java.util.Calendar to)
c -
public static boolean isSameDate(java.util.Calendar c1,
java.util.Calendar c2)
c1 - c2 -
public static boolean isSameTimeHMS(java.util.Calendar c1,
java.util.Calendar c2)
c1 - c2 -
public static boolean isSameTimeHMSM(java.util.Calendar c1,
java.util.Calendar c2)
c1 - c2 -
public static java.lang.String getDateSeparator()
public static java.lang.String getDateSeparator(java.util.Locale locale)
locale -
public static long distanceInDays(java.util.Calendar c1,
java.util.Calendar c2)
c1 - c2 -
public static long distanceInMilliseconds(java.util.Calendar c1,
java.util.Calendar c2)
c1 - c2 -
public static java.util.Calendar setFromMilliseconds(java.util.Calendar calendar,
long value)
value - public static long getUnixDay(java.util.Calendar c)
public static long getJulianDay(java.util.Calendar c)
for more information about local C-JDNpublic static java.lang.String filePrefix(java.util.Calendar calendar)
calendar - the calendar
public static java.lang.String filePrefix()
public static java.lang.String filePrefixLong(java.util.Calendar calendar)
calendar - the calendar
public static java.lang.String filePrefixLong()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||