public final class DateUtility extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
dynamicString(Date date)
put your documentation comment here
|
static int |
getAge(Date fromDate)
Returns age - a period of time, measured by years from fromDate till now
|
static int |
getAge(Date fromDate,
Date toDate)
Returns age - a period of time, measured by years from fromDate to toDate
|
static int |
getAge(long fromDate)
Returns age - a period of time, measured by years from fromDate till now
|
static int |
getAge(long fromDate,
long toDate)
Returns age - a period of time, measured by years from fromDate to toDate
|
static int |
getCalendarWeekForDate(Date date)
Returns the calendar week for this date.
|
static long |
getDayBeginning(long date) |
static long |
getDayEnding(long date) |
static int |
getDays(Date fromDate) |
static int |
getDays(Date fromDate,
Date toDate) |
static int |
getDays(long fromDate) |
static int |
getDays(long fromDate,
long toDate) |
static Date |
getFirstDayOfWeek(int week,
int year)
Returns the date for the first day of a "calendar week" for a given year.
|
static long |
getHourBeginning() |
static long |
getHourBeginning(long date) |
static long |
getNextHourBeginning() |
static long |
getNextHourBeginning(long date) |
static boolean |
isAfter(Date d1,
Date d2)
Returns true if the first date is after second date.
|
static boolean |
isAfterNow(Date d) |
static boolean |
isBefore(Date d1,
Date d2)
put your documentation comment here
|
static boolean |
isBeforeNow(Date d) |
static boolean |
isSame(Date d1,
Date d2)
put your documentation comment here
|
static boolean |
isToday(Date date)
Return true if incoming
Date is Today, false otherwise. |
static Date |
nextDate(Date d)
put your documentation comment here
|
static Date |
nextWeek(Date d)
Returns the date which lies one week after given date.
|
static Date |
previousDate(Date d)
put your documentation comment here
|
static String |
toDateOnly(Date d)
put your documentation comment here
|
static String |
toDayAndMonthOnly(Date d)
put your documentation comment here
|
static GregorianCalendar |
toLocalTime(GregorianCalendar date)
put your documentation comment here
|
static String |
toTimeOnly(Date d)
put your documentation comment here
|
public static boolean isAfterNow(Date d)
public static boolean isAfter(Date d1, Date d2)
d1 - d2 - public static boolean isBeforeNow(Date d)
public static boolean isBefore(Date d1, Date d2)
d1 - d2 - public static boolean isToday(Date date)
Date is Today, false otherwise.
IllegalArgumentException will be thrown if incoming Date is null.date - Date to checkpublic static boolean isSame(Date d1, Date d2)
d1 - d2 - public static Date nextDate(Date d)
d - public static Date previousDate(Date d)
d - public static GregorianCalendar toLocalTime(GregorianCalendar date)
date - public static String toDateOnly(Date d)
d - public static String toDayAndMonthOnly(Date d)
d - public static String toTimeOnly(Date d)
d - public static String dynamicString(Date date)
date - public static int getCalendarWeekForDate(Date date)
public static Date getFirstDayOfWeek(int week, int year)
week - year - public static int getAge(long fromDate)
fromDate - start date in millspublic static int getAge(Date fromDate)
fromDate - start datepublic static int getAge(long fromDate,
long toDate)
fromDate - start date in millstoDate - end date in millspublic static int getAge(Date fromDate, Date toDate)
fromDate - start datetoDate - end datepublic static int getDays(Date fromDate)
public static int getDays(long fromDate)
public static int getDays(long fromDate,
long toDate)
public static long getHourBeginning()
public static long getHourBeginning(long date)
public static long getNextHourBeginning()
public static long getNextHourBeginning(long date)
public static long getDayBeginning(long date)
public static long getDayEnding(long date)
Copyright © 2010-2014 anotheria.net. All Rights Reserved.