Package ca.uhn.fhir.model.primitive
Class DateTimeDt
java.lang.Object
ca.uhn.fhir.model.api.BaseElement
ca.uhn.fhir.model.api.BaseIdentifiableElement
ca.uhn.fhir.model.api.BasePrimitive<Date>
ca.uhn.fhir.model.primitive.BaseDateTimeDt
ca.uhn.fhir.model.primitive.DateTimeDt
- All Implemented Interfaces:
IDatatype
,IElement
,IIdentifiableElement
,IPrimitiveDatatype<Date>
,ISupportsUndeclaredExtensions
,Externalizable
,Serializable
,IBase
,IBaseDatatype
,IPrimitiveType<Date>
Represents a FHIR dateTime datatype. Valid precisions values for this type are:
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final TemporalPrecisionEnum
The default precision for this typeFields inherited from class ca.uhn.fhir.model.primitive.BaseDateTimeDt
NOW_DATE_CONSTANT, TODAY_DATE_CONSTANT
-
Constructor Summary
ConstructorDescriptionConstructorDateTimeDt
(String theValue) Create a new instance using a string date/timeDateTimeDt
(Date theDate) Create a new DateTimeDt with seconds precision and the local time zoneDateTimeDt
(Date theDate, TemporalPrecisionEnum thePrecision) Constructor which accepts a date value and a precision value.DateTimeDt
(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimezone) Constructor which accepts a date value, precision value, and time zone. -
Method Summary
Modifier and TypeMethodDescriptionprotected TemporalPrecisionEnum
Returns the default precision for this datatypeprotected boolean
isPrecisionAllowed
(TemporalPrecisionEnum thePrecision) To be implemented by subclasses to indicate whether the given precision is allowed by this typestatic DateTimeDt
Returns a new instance of DateTimeDt with the current system time and SECOND precision and the system local time zoneMethods inherited from class ca.uhn.fhir.model.primitive.BaseDateTimeDt
encode, getDay, getHour, getMillis, getMinute, getMonth, getNanos, getPrecision, getSecond, getTimeZone, getValueAsCalendar, getYear, isTimeZoneZulu, isToday, parse, setDay, setHour, setMillis, setMinute, setMonth, setNanos, setPrecision, setSecond, setTimeZone, setTimeZoneZulu, setValue, setValue, setValueAsString, setYear, toHumanDisplay, toHumanDisplayLocalTimezone
Methods inherited from class ca.uhn.fhir.model.api.BasePrimitive
equals, getValue, getValueAsString, hashCode, hasValue, isEmpty, readExternal, toString, updateStringValue, writeExternal
Methods inherited from class ca.uhn.fhir.model.api.BaseIdentifiableElement
getElementSpecificId, getId, setElementSpecificId, setId, setId
Methods inherited from class ca.uhn.fhir.model.api.BaseElement
addUndeclaredExtension, addUndeclaredExtension, addUndeclaredExtension, getAllUndeclaredExtensions, getFormatCommentsPost, getFormatCommentsPre, getUndeclaredExtensions, getUndeclaredExtensionsByUrl, getUndeclaredModifierExtensions, getUserData, hasFormatComment, isBaseEmpty, setUserData
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.hl7.fhir.instance.model.api.IBase
fhirType, getFormatCommentsPost, getFormatCommentsPre, getUserData, hasFormatComment, setUserData
-
Field Details
-
DEFAULT_PRECISION
The default precision for this type
-
-
Constructor Details
-
DateTimeDt
public DateTimeDt()Constructor -
DateTimeDt
Create a new DateTimeDt with seconds precision and the local time zone -
DateTimeDt
Constructor which accepts a date value and a precision value. Valid precisions values for this type are:- Throws:
DataFormatException
- If the specified precision is not allowed for this type
-
DateTimeDt
Create a new instance using a string date/time- Throws:
DataFormatException
- If the specified precision is not allowed for this type
-
DateTimeDt
Constructor which accepts a date value, precision value, and time zone. Valid precisions values for this type are:
-
-
Method Details
-
isPrecisionAllowed
Description copied from class:BaseDateTimeDt
To be implemented by subclasses to indicate whether the given precision is allowed by this type- Specified by:
isPrecisionAllowed
in classBaseDateTimeDt
-
withCurrentTime
Returns a new instance of DateTimeDt with the current system time and SECOND precision and the system local time zone -
getDefaultPrecisionForDatatype
Returns the default precision for this datatype- Specified by:
getDefaultPrecisionForDatatype
in classBaseDateTimeDt
- See Also:
-