public class SIPDate extends Object implements Cloneable, Serializable
From the HTTP 1.1 spec 14.18 Date The Date general-header field represents the date and time at which the message was originated, having the same semantics as orig-date in RFC 822. The field value is an HTTP-date, as described in section 3.3.1; it MUST be sent in RFC 1123 [8]-date format. Date = "Date" ":" HTTP-date An example is Date: Tue, 15 Nov 1994 08:12:31 GMT
Modifier and Type | Field and Description |
---|---|
static String |
APR |
static String |
AUG |
protected int |
day
day member
|
static String |
DEC |
static String |
FEB |
static String |
FRI |
static String |
GMT |
protected int |
hour
hour member
|
static String |
JAN |
static String |
JUL |
static String |
JUN |
static String |
MAR |
static String |
MAY |
protected int |
minute
minute member
|
static String |
MON |
protected int |
month
month member
|
static String |
NOV |
static String |
OCT |
static String |
SAT |
protected int |
second
second member
|
static String |
SEP |
protected String |
sipMonth
sipMonth member
|
protected String |
sipWkDay
sipWkDay member
|
static String |
SUN |
static String |
THU |
static String |
TUE |
static String |
WED |
protected int |
wkday
wkday member
|
protected int |
year
year member
|
Constructor and Description |
---|
SIPDate()
Initializer, sets all the fields to invalid values.
|
SIPDate(long timeMillis)
Construct a SIP date from the time offset given in miliseconds
|
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
StringBuilder |
encode(StringBuilder encoding)
Get canonical string representation.
|
boolean |
equals(Object that)
equality check.
|
int |
getDeltaSeconds()
Get the time offset from the current time.
|
int |
getHour()
get the hour
|
Calendar |
getJavaCal()
The only accessor we allow is to the java calendar record.
|
int |
getMinute()
get the minute
|
String |
getMonth()
get the month
|
int |
getSecond()
get the second
|
String |
getWkday()
get the WkDay field
|
int |
getYear()
Get the year member.
|
void |
setDay(int d)
Set the day member
|
void |
setHour(int h)
Set the hour member
|
void |
setMinute(int m)
Set the minute member
|
void |
setMonth(String m)
Set the month member
|
void |
setSecond(int s)
Set the second member
|
void |
setWkday(String w)
Set the wkday member
|
void |
setYear(int y)
Set the year member
|
public static final String GMT
public static final String MON
public static final String TUE
public static final String WED
public static final String THU
public static final String FRI
public static final String SAT
public static final String SUN
public static final String JAN
public static final String FEB
public static final String MAR
public static final String APR
public static final String MAY
public static final String JUN
public static final String JUL
public static final String AUG
public static final String SEP
public static final String OCT
public static final String NOV
public static final String DEC
protected String sipWkDay
protected String sipMonth
protected int wkday
protected int day
protected int month
protected int year
protected int hour
protected int minute
protected int second
public SIPDate()
public SIPDate(long timeMillis)
timeMillis
- long to setpublic boolean equals(Object that)
public StringBuilder encode(StringBuilder encoding)
public Calendar getJavaCal()
public String getWkday()
public String getMonth()
public int getHour()
public int getMinute()
public int getSecond()
public void setWkday(String w) throws IllegalArgumentException
w
- String to setIllegalArgumentException
- if w is not a valid day.public void setDay(int d) throws IllegalArgumentException
d
- int to setIllegalArgumentException
- if d is not a valid daypublic void setMonth(String m) throws IllegalArgumentException
m
- String to set.IllegalArgumentException
- if m is not a valid monthpublic void setYear(int y) throws IllegalArgumentException
y
- int to setIllegalArgumentException
- if y is not a valid year.public int getYear()
public void setHour(int h) throws IllegalArgumentException
h
- int to setIllegalArgumentException
- if h is not a valid hour.public void setMinute(int m) throws IllegalArgumentException
m
- int to setIllegalArgumentException
- if m is not a valid minutepublic void setSecond(int s) throws IllegalArgumentException
s
- int to setIllegalArgumentException
- if s is not a valid secondpublic int getDeltaSeconds()
Copyright © 2015. All Rights Reserved.