Class DateTimeType

All Implemented Interfaces:
ca.uhn.fhir.model.api.IElement, Externalizable, Serializable, org.hl7.fhir.instance.model.api.IBase, org.hl7.fhir.instance.model.api.IBaseDatatype, org.hl7.fhir.instance.model.api.IBaseElement, org.hl7.fhir.instance.model.api.IBaseHasExtensions, org.hl7.fhir.instance.model.api.IPrimitiveType<Date>

public class DateTimeType extends BaseDateTimeType
Represents a FHIR dateTime datatype. Valid precisions values for this type are:
  • TemporalPrecisionEnum.YEAR
  • TemporalPrecisionEnum.MONTH
  • TemporalPrecisionEnum.DAY
  • TemporalPrecisionEnum.SECOND
  • TemporalPrecisionEnum.MILLI
See Also:
  • Field Details

    • DEFAULT_PRECISION

      public static final ca.uhn.fhir.model.api.TemporalPrecisionEnum DEFAULT_PRECISION
      The default precision for this type
  • Constructor Details

    • DateTimeType

      public DateTimeType()
      Constructor
    • DateTimeType

      public DateTimeType(Date theDate)
      Create a new DateTimeDt with seconds precision and the local time zone
    • DateTimeType

      public DateTimeType(Date theDate, ca.uhn.fhir.model.api.TemporalPrecisionEnum thePrecision)
      Constructor which accepts a date value and a precision value. Valid precisions values for this type are:
      • TemporalPrecisionEnum.YEAR
      • TemporalPrecisionEnum.MONTH
      • TemporalPrecisionEnum.DAY
      • TemporalPrecisionEnum.SECOND
      • TemporalPrecisionEnum.MILLI
      Throws:
      DataFormatException - If the specified precision is not allowed for this type
    • DateTimeType

      public DateTimeType(String theValue)
      Create a new instance using a string date/time
      Throws:
      DataFormatException - If the specified precision is not allowed for this type
    • DateTimeType

      public DateTimeType(Date theDate, ca.uhn.fhir.model.api.TemporalPrecisionEnum thePrecision, TimeZone theTimezone)
      Constructor which accepts a date value, precision value, and time zone. Valid precisions values for this type are:
      • TemporalPrecisionEnum.YEAR
      • TemporalPrecisionEnum.MONTH
      • TemporalPrecisionEnum.DAY
      • TemporalPrecisionEnum.SECOND
      • TemporalPrecisionEnum.MILLI
    • DateTimeType

      public DateTimeType(Calendar theCalendar)
      Constructor
  • Method Details