public class DateUtil
extends java.lang.Object
构造器和说明 |
---|
DateUtil() |
限定符和类型 | 方法和说明 |
---|---|
static java.lang.String |
getCurrentAsString() |
static java.lang.String |
getDateAsString(java.util.Date date)
Convert a given
Date object to a RFC 1123
formatted String . |
static long |
parseToMilliseconds(java.lang.String dateValue)
Parse a given date
String to a long
representation of the time. |
static java.lang.String |
parseToRFC1123(long dateValue)
Converts a millisecond representation of a date to a
RFC 1123 formatted String . |
public static java.lang.String getCurrentAsString()
public static long parseToMilliseconds(java.lang.String dateValue)
String
to a long
representation of the time. Where the provided value is all digits the
value is returned as a long
, otherwise attempt is made to
parse the String
as a RFC 1123 date.dateValue
- the value to parse.long
value following parse, or zero where not
successful.public static java.lang.String parseToRFC1123(long dateValue)
RFC 1123
formatted String
.dateValue
- the Date
represented as milliseconds.String
representation of the date.public static java.lang.String getDateAsString(java.util.Date date)
Date
object to a RFC 1123
formatted String
.date
- the Date
object to convertString
representation of the date.