public class TimeHelper extends Object
| Constructor and Description |
|---|
TimeHelper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
format(Calendar c,
boolean time)
Return a human-readable representation of the given calendar.
|
static Calendar |
getCalendar(long timestamp)
Computes a Calendar for the given timestamp
|
static Calendar |
getCalendar(String timestamp) |
static Calendar |
getEnd(int year,
int week)
Compute the calendar object corresponding to the end of the week of the
given year
|
static String |
getHumanReadableTime(long seconds)
Produce a human-readable representation of the given timestamp.
|
static String |
getISO8601(long seconds)
Compute a ISO9601 representation of the given timestamp
|
static Calendar |
getMonthEnd(int year,
int month) |
static Calendar |
getMonthStart(int year,
int month) |
static Calendar |
getStart(int year,
int week)
Compute the calendar object corresponding to the start of the week of the
given year
|
public static Calendar getStart(int year, int week)
year - week - public static Calendar getMonthStart(int year, int month)
public static Calendar getEnd(int year, int week)
year - week - public static Calendar getMonthEnd(int year, int month)
public static String format(Calendar c, boolean time)
c - the calendar object to formattime - whether you want HH:MM:SS information as wellpublic static Calendar getCalendar(long timestamp)
timestamp - public static Calendar getCalendar(String timestamp) throws NumberFormatException
NumberFormatExceptionpublic static String getHumanReadableTime(long seconds)
seconds - public static String getISO8601(long seconds)
seconds - Copyright © 2015. All Rights Reserved.