
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
FieldsModifier and TypeFieldDescriptionstatic final TemporalPrecisionEnumThe default precision for this typeFields inherited from class ca.uhn.fhir.model.primitive.BaseDateTimeDt
NOW_DATE_CONSTANT, TODAY_DATE_CONSTANT -
Constructor Summary
ConstructorsConstructorDescriptionConstructorDateTimeDt(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 TemporalPrecisionEnumReturns the default precision for this datatypeprotected booleanisPrecisionAllowed(TemporalPrecisionEnum thePrecision) To be implemented by subclasses to indicate whether the given precision is allowed by this typestatic DateTimeDtReturns 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, toHumanDisplayLocalTimezoneMethods inherited from class ca.uhn.fhir.model.api.BasePrimitive
equals, getValue, getValueAsString, hashCode, hasValue, isEmpty, readExternal, toString, updateStringValue, writeExternalMethods inherited from class ca.uhn.fhir.model.api.BaseIdentifiableElement
getElementSpecificId, getId, setElementSpecificId, setId, setIdMethods inherited from class ca.uhn.fhir.model.api.BaseElement
addUndeclaredExtension, addUndeclaredExtension, addUndeclaredExtension, getAllUndeclaredExtensions, getFormatCommentsPost, getFormatCommentsPre, getUndeclaredExtensions, getUndeclaredExtensionsByUrl, getUndeclaredModifierExtensions, getUserData, hasFormatComment, isBaseEmpty, setUserDataMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:BaseDateTimeDtTo be implemented by subclasses to indicate whether the given precision is allowed by this type- Specified by:
isPrecisionAllowedin 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:
getDefaultPrecisionForDatatypein classBaseDateTimeDt- See Also:
-