public class DateUtil extends Object
Constructor and Description |
---|
DateUtil() |
Modifier and Type | Method and Description |
---|---|
static String |
formatForHttpHeader(Date date)
Can be used to format a date into http header compatible
strings.
|
static String |
formatForHttpHeader(Long unixTime)
Can be used to format a unix timestamp into
http header compatible strings.
|
static Date |
parseHttpDateFormat(String httpDateFormat)
Can be used to parse http times.
|
static org.joda.time.DateTime |
parseHttpDateFormatToDateTime(String httpDateFormat)
Can be used to parse http times.
|
public static String formatForHttpHeader(Date date)
date
- The date to formatpublic static String formatForHttpHeader(Long unixTime)
date
- The long (unixtime) to formatpublic static Date parseHttpDateFormat(String httpDateFormat) throws IllegalArgumentException
httpDateFormat
- in http format: Date: Tue, 26 Mar 2013 13:47:13 GMTParseException
- If something goes wrong.IllegalArgumentException
public static org.joda.time.DateTime parseHttpDateFormatToDateTime(String httpDateFormat) throws IllegalArgumentException
httpDateFormat
- in http format: Date: Tue, 26 Mar 2013 13:47:13 GMTParseException
- If something goes wrong.IllegalArgumentException
Copyright © 2019 ninjaframework. All rights reserved.