public class DateUtil extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
DAY_IN_MS |
Constructor and Description |
---|
DateUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
format(java.lang.String format,
java.util.Date date)
Return the specified date in String format.
|
static long |
getDay()
Return elapsed day from 01/01/1970
|
static long |
getTime()
Returns elapsed milli second from 01/01/1970 (same as
System.currentTimeMillis() ) |
static java.lang.String |
getTimeAsString(double valueInMs)
Returns given time in ms in in international time String format.
|
static long |
keepDay(long time)
Keep only the day part information from the given time (elapsed milli second from
01/01/1970).
|
static long |
keepTime(long time)
Keep only the time information (hour, minute, second and milli second) from the given time
(elapsed milli second from 01/01/1970).
|
static java.util.Date |
now()
Return current date.
|
static java.lang.String |
now(java.lang.String format)
Return current date (String format).
|
public static final long DAY_IN_MS
public DateUtil()
public static long getTime()
System.currentTimeMillis()
)public static long keepDay(long time)
System.currentTimeMillis()
public static long keepTime(long time)
System.currentTimeMillis()
public static long getDay()
System.currentTimeMillis()
public static java.util.Date now()
public static java.lang.String now(java.lang.String format)
format
- define the wanted format.public static java.lang.String format(java.lang.String format, java.util.Date date)
format
- define the wanted format.public static java.lang.String getTimeAsString(double valueInMs)
valueInMs
- : value in milliseconds