public class Date extends Iso8601
4.3.4 Date Value Name: DATE Purpose: This value type is used to identify values that contain a calendar date. Formal Definition: The value type is defined by the following notation: date = date-value date-value = date-fullyear date-month date-mday date-fullyear = 4DIGIT date-month = 2DIGIT ;01-12 date-mday = 2DIGIT ;01-28, 01-29, 01-30, 01-31 ;based on month/year Description: If the property permits, multiple "date" values are specified as a COMMA character (US-ASCII decimal 44) separated list of values. The format for the value type is expressed as the [ISO 8601] complete representation, basic format for a calendar date. The textual format specifies a four-digit year, two-digit month, and two-digit day of the month. There are no separator characters between the year, month and day component text. No additional content value encoding (i.e., BACKSLASH character encoding) is defined for this value type. Example: The following represents July 14, 1997: 19970714
Modifier | Constructor and Description |
---|---|
|
Date()
Default constructor.
|
|
Date(java.util.Date date) |
protected |
Date(int precision,
java.util.TimeZone tz)
Creates a new date instance with the specified precision.
|
|
Date(long time) |
protected |
Date(long time,
int precision,
java.util.TimeZone tz)
Creates a new date instance with the specified precision.
|
|
Date(java.lang.String value) |
|
Date(java.lang.String value,
java.lang.String pattern) |
public Date()
protected Date(int precision, java.util.TimeZone tz)
precision
- the date precisiontz
- the timezoneDates.PRECISION_DAY
,
Dates.PRECISION_SECOND
public Date(long time)
time
- a date value in millisecondsprotected Date(long time, int precision, java.util.TimeZone tz)
time
- a date value in millisecondsprecision
- the date precisiontz
- the timezoneDates.PRECISION_DAY
,
Dates.PRECISION_SECOND
public Date(java.util.Date date)
date
- a date valuepublic Date(java.lang.String value) throws java.text.ParseException
value
- a string representation of a datejava.text.ParseException
- where the specified string is not a valid datepublic Date(java.lang.String value, java.lang.String pattern) throws java.text.ParseException
value
- a string representation of a datepattern
- a date pattern to apply when parsingjava.text.ParseException
- where the specified string is not a valid dateCopyright © 2004-2015 Micronode. All Rights Reserved.