public final class DateValue extends Value
This is an immutable class.
BooleanValue,
HexValue,
StringValue,
LongValue,
StreamValue,
Serialized Form| Constructor and Description |
|---|
DateValue(Syntax syntax,
java.util.Date date)
Constructor that uses a Date object.
|
DateValue(Syntax syntax,
long millis)
Constructs a DateValue object using an integer.
|
DateValue(Syntax syntax,
java.lang.String genTime)
Constructs a DateValue object using a Generalized Time string.
|
| Modifier and Type | Method and Description |
|---|---|
static long |
generalizedTimeToMs(java.lang.String gen)
Convert a string in Generalized Time form to milliseconds since 1970.
|
java.lang.String |
getGeneralizedTime()
Returns the value as a String in Generalized Time format.
|
long |
getMillis()
Returns the value as an integer.
|
java.lang.Object |
getObjectValue()
Returns the value as an Object of instance Date.
|
java.util.Date |
getValue()
Returns the value as a Date.
|
static java.lang.String |
msToGeneralizedTime(long ms)
Convert milliseconds since 1970 to a string in Generalized Time form.
|
compareTo, equals, getSyntax, isWithinBounds, toStringpublic DateValue(Syntax syntax, java.util.Date date)
This constructor should only be called from date/time strategy classes and not directly in an application.
syntax - Associated syntax for this date value.date - The Date object.public DateValue(Syntax syntax, long millis)
This constructor should only be called from date/time strategy classes and not directly in an application.
syntax - Associated syntax for this date value.millis - The milliseconds since Jan 1, 1970.public DateValue(Syntax syntax, java.lang.String genTime)
This constructor should only be called from date/time strategy classes and not directly in an application.
syntax - Associated syntax for this date value.genTime - The Generalized Time string in the form: "YYYYMMDDhhmmssZ"public java.util.Date getValue()
public java.lang.Object getObjectValue()
getObjectValue in class Valuepublic long getMillis()
public java.lang.String getGeneralizedTime()
public static java.lang.String msToGeneralizedTime(long ms)
Generalized Time is in the form: "YYYYMMDDhhmmssZ" The Z indicates UTC time.
See X.208 or ISO8601 for the complete Generalized Time spec.
ms - A long containing milliseconds since midnight Jan 1970.public static long generalizedTimeToMs(java.lang.String gen)
Generalized Time is in the form: "YYYYMMDDhhmmssZ" The Z indicates UTC time. Although there are many forms for Generalized Time, this routine supports only the 15-character form listed above.
See X.208 or ISO8601 for the complete Generalized Time spec.
gen - A String containing date and time in Generalized Time format.
API Documentation Copyright © 1998-2004 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated ${TODAY} ${TSTAMP}.