Package org.apache.mina.http
Class DateUtil
- java.lang.Object
-
- org.apache.mina.http.DateUtil
-
public class DateUtil extends Object
An utility class for Dates manipulations- Author:
- Apache MINA Project
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getCurrentAsString()
static String
getDateAsString(Date date)
Convert a givenDate
object to aRFC 1123
formattedString
.static long
parseToMilliseconds(String dateValue)
Parse a given dateString
to along
representation of the time.static String
parseToRFC1123(long dateValue)
Converts a millisecond representation of a date to aRFC 1123
formattedString
.
-
-
-
Method Detail
-
getCurrentAsString
public static String getCurrentAsString()
- Returns:
- The current date as a string
-
parseToMilliseconds
public static long parseToMilliseconds(String dateValue)
Parse a given dateString
to along
representation of the time. Where the provided value is all digits the value is returned as along
, otherwise attempt is made to parse theString
as a RFC 1123 date.- Parameters:
dateValue
- the value to parse.- Returns:
- the
long
value following parse, or zero where not successful.
-
parseToRFC1123
public static String parseToRFC1123(long dateValue)
Converts a millisecond representation of a date to aRFC 1123
formattedString
.- Parameters:
dateValue
- theDate
represented as milliseconds.- Returns:
- a
String
representation of the date.
-
-