FHIRTime
public struct FHIRTime: DateAndTime
A time during the day, optionally with seconds, usually for human communication. Named FHIRTime to match with FHIRDate.
Minimum of 00:00 and maximum of < 24:00. There is no timezone. Since decimal precision has significance in FHIR, Time initialized from a string will remember the seconds string until it is manually set.
-
The hour of the day; cannot be higher than 23.
Declaration
Swift
public var hour: UInt8 -
The minute of the hour; cannot be larger than 59
Declaration
Swift
public var minute: UInt8 -
The second of the minute; must be smaller than 60
Declaration
Swift
public var second: Double? -
If initialized from string, this was the string for the seconds; we use this to remember precision.
Declaration
Swift
public internal(set) var tookSecondsFromString: String? -
An optional id of the element.
Declaration
Swift
public var id: String? -
The parent/owner of the receiver, if any. Used to dereference resources.
Declaration
Swift
public weak var _owner: FHIRAbstractBase? -
Optional extensions of the element.
Declaration
Swift
public var extension_fhir: [Extension]? -
The clock time of right now.
Declaration
Swift
public static var now: FHIRTime -
Designated initializer. Overflows seconds and minutes to arrive at the final time, which must be less than 24:00:00 or it will be capped.
The
secondsFromStringparameter will be discarded if it is negative or higher than 60.Declaration
Swift
public init(hour: UInt8, minute: UInt8, second: Double?, secondsFromString: String? = nil)Parameters
hourHour of day, cannot be greater than 23 (a time of 24:00 is illegal)
minuteMinutes of the hour; if greater than 59 will roll over into hours
secondSeconds of the minute; if 60 or more will roll over into minutes and discard
secondsFromStringsecondsFromStringIf time was initialized from a string, you can provide the seconds string here to ensure precision is kept. You are responsible to ensure that this string actually represents what’s passed into
seconds. -
Initializes a time from a time string by passing it through
DateAndTimeParser.Will fail unless the string contains at least hour and minute.
Declaration
Swift
public init?(string: String)
-
Declaration
Swift
public init(json: JSONType, owner: FHIRAbstractBase?, context: inout FHIRInstantiationContext)Parameters
jsonThe value in its associated
JSONTypeownerOptional, the owning element
contextAn in-out parameter for the instantiation context
-
Declaration
Swift
public func asJSON(errors: inout [FHIRValidationError]) -> JSONTypeParameters
errorsErrors encountered during serialization
Return Value
The FHIRJSON reperesentation of the receiver
TODO: this implementation uses a workaround using string coercion instead of format: "%02d:%02d:%@" because %@ with String is not
-
Declaration
Swift
public var description: String
-
Declaration
Swift
public static func ==(lhs: FHIRTime, rhs: FHIRTime) -> BoolParameters
lhsA value to compare.
rhsAnother value to compare.
-
Declaration
Swift
public static func <(lhs: FHIRTime, rhs: FHIRTime) -> BoolParameters
lhsA value to compare.
rhsAnother value to compare.
View on GitHub
Install in Dash
FHIRTime Struct Reference