public class DateUtil extends Object
Modifier and Type | Method and Description |
---|---|
static String |
getCurrentAsString() |
static String |
getDateAsString(Date date)
Convert a given
Date object to a RFC 1123
formatted String . |
static long |
parseToMilliseconds(String dateValue)
Parse a given date
String to a long
representation of the time. |
static String |
parseToRFC1123(long dateValue)
Converts a millisecond representation of a date to a
RFC 1123 formatted String . |
public static String getCurrentAsString()
public static long parseToMilliseconds(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 String parseToRFC1123(long dateValue)
RFC 1123
formatted String
.dateValue
- the Date
represented as milliseconds.String
representation of the date.Copyright © 2004–2018 Apache MINA Project. All rights reserved.