public final class Times extends Object
| Modifier and Type | Method and Description |
|---|---|
static long |
getDayEndTime(long time)
Gets the day end time with the specified time.
|
static long |
getDayStartTime(long time)
Gets the day start time with the specified time.
|
static long |
getMonthEndTime(long time)
Gets the month end time with the specified time.
|
static long |
getMonthStartTime(long time)
Gets the month start time with the specified time.
|
static String |
getTimeAgo(long time,
Locale locale)
Gets time ago format text.
|
static int |
getWeekDay(long time)
Gets the week day with the specified time.
|
static long |
getWeekEndTime(long time)
Gets the week end time with the specified time.
|
static long |
getWeekStartTime(long time)
Gets the week start time with the specified time.
|
static boolean |
isSameDay(Date date1,
Date date2)
Determines whether the specified date1 is the same day with the specified date2.
|
static boolean |
isSameMonth(Date date1,
Date date2)
Determines whether the specified date1 is the same month with the specified date2.
|
static boolean |
isSameWeek(Date date1,
Date date2)
Determines whether the specified date1 is the same week with the specified date2.
|
public static String getTimeAgo(long time, Locale locale)
time - the specified time.locale - the specified localepublic static boolean isSameDay(Date date1, Date date2)
date1 - the specified date1date2 - the specified date2true if it is the same day, returns false otherwisepublic static boolean isSameWeek(Date date1, Date date2)
date1 - the specified date1date2 - the specified date2true if it is the same week, returns false otherwisepublic static boolean isSameMonth(Date date1, Date date2)
date1 - the specified date1date2 - the specified date2true if it is the same month, returns false otherwisepublic static long getDayStartTime(long time)
time - the specified timepublic static long getDayEndTime(long time)
time - the specified timepublic static int getWeekDay(long time)
time - the specified timepublic static long getWeekStartTime(long time)
time - the specified timepublic static long getWeekEndTime(long time)
time - the specified timepublic static long getMonthStartTime(long time)
time - the specified timepublic static long getMonthEndTime(long time)
time - the specified timeCopyright © 2009–2019 B3log. All rights reserved.