public class HttpDateTime
extends java.lang.Object
For internal use only.
Modifier and Type | Method and Description |
---|---|
int |
getDay()
Return day field of date (1 to 31).
|
int |
getDayOfWeek()
Return day of week (1 to 7).
|
int |
getDayOfYear()
Return day of year (1 to 366).
|
int |
getHour()
Return hour field of time (0 to 23).
|
int |
getMinute()
Return minute field of time (0 to 59).
|
int |
getMonth()
Return month field of date (1 to 12).
|
int |
getSecond()
Return second field of time (0 to 59).
|
int |
getYear()
Return year field of date.
|
static HttpDateTime |
of(int year,
int month,
int day,
int hour,
int minute,
int second)
Creates an instance of HTTP date/time.
|
static HttpDateTime |
ofGlobal(GlobalDateTime value)
Return the specified global date/time value converted to an HTTP date/time.
|
static HttpDateTime |
parse(java.lang.String text)
|
static HttpDateTime |
parse(java.lang.String text,
boolean fix)
Parses the string representation of HTTP date/time.
|
GlobalDateTime |
toGlobal()
Return this value converted to a global date and time.
|
java.lang.String |
toString()
Returns the string representation in RFC 7231's IMF-fixdate format.
|
public int getDay()
Return day field of date (1 to 31).
public int getDayOfWeek()
Return day of week (1 to 7).
public int getDayOfYear()
Return day of year (1 to 366).
public int getHour()
Return hour field of time (0 to 23).
public int getMinute()
Return minute field of time (0 to 59).
public int getMonth()
Return month field of date (1 to 12).
public int getSecond()
Return second field of time (0 to 59).
public int getYear()
Return year field of date.
public static HttpDateTime of(int year, int month, int day, int hour, int minute, int second)
Creates an instance of HTTP date/time.
year
- The year field (0 to 9999).month
- The month field (1 to 12).day
- The day field (1 to 31).hour
- The hour field (0 to 23).minute
- The minute field (0 to 59).second
- The second field (0 to 59).public static HttpDateTime ofGlobal(GlobalDateTime value)
Return the specified global date/time value converted to an HTTP date/time.
value
- Global date/timne value.public static HttpDateTime parse(java.lang.String text)
text
- Text parameter.public static HttpDateTime parse(java.lang.String text, boolean fix)
Parses the string representation of HTTP date/time.
text
- The text to be parsed.fix
- True if only RFC 7231's IMF-fixdate format should be permitted.null
if parsing failed.public GlobalDateTime toGlobal()
Return this value converted to a global date and time.
public java.lang.String toString()
Returns the string representation in RFC 7231's IMF-fixdate format.
toString
in class java.lang.Object