Instant
public struct Instant: DateAndTime
An instant in time, known at least to the second and with a timezone, for machine times.
-
The date.
Declaration
Swift
public var date: FHIRDate -
The time, including seconds.
Declaration
Swift
public var time: FHIRTime -
The timezone.
Declaration
Swift
public var timeZone: TimeZone -
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]? -
This very instant: an Instant instance representing current date and time.
Declaration
Swift
public static var now: Instant -
Designated initializer.
Parameters
dateThe date of the instant; ensures to have month and day (which are optional in the
FHIRDateconstruct)timeThe time of the instant; ensures to have seconds (which are optional in the
FHIRTimeconstruct)timeZoneThe timezone
-
Uses
DateAndTimeParserto initialize from a date-time string.Declaration
Swift
public init?(string: String)Parameters
stringThe string to parse the instant from
-
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
-
Undocumented
Declaration
Swift
public struct Instant: DateAndTime -
Declaration
Swift
public var description: String
-
Declaration
Swift
public static func ==(lhs: Instant, rhs: Instant) -> BoolParameters
lhsA value to compare.
rhsAnother value to compare.
-
Declaration
Swift
public static func <(lhs: Instant, rhs: Instant) -> BoolParameters
lhsA value to compare.
rhsAnother value to compare.
-
Attempts to parse an Instant from RFC1123-formatted date strings, usually used by HTTP headers:
EEE’,’ dd MMM yyyy HH’:‘mm’:‘ss z
EEEE’,’ dd’-'MMM’-'yy HH’:'mm’:'ss z
(RFC850)EEE MMM d HH’:'mm’:'ss yyyy
Created by taking liberally from Marcus Rohrmoser’s blogpost at http://blog.mro.name/2009/08/nsdateformatter-http-header/
Declaration
Swift
public static func fromHttpDate(_ httpDate: String) -> Instant?Parameters
httpDateThe date string to parse
Return Value
An Instant if parsing was successful, nil otherwise
View on GitHub
Install in Dash
Instant Struct Reference