func testExample() throws {
let start = DateTime(
date: FHIRDate(string: "1990-08-17")!,
time: FHIRTime(hour: 12, minute: 8, second: 20.99999),
timeZone: TimeZone.current
)
print("Start date as json: \(start.description)")
print("Start date as NSDate: \(start.nsDate)")
}
I get the following output
Start date as json: 1990-08-17T12:08:21+02:00
Start date as NSDate: 1990-08-17 10:08:20 +0000
I'm wondering why the DateTime rounds up to the nearest second (it has a precision of 4 decimals of milliseconds), when the NSDate doesn't. Is this an issue (it could potentially mean that something happen a second earlier/later then expected)?
Given this example
I get the following output
I'm wondering why the DateTime rounds up to the nearest second (it has a precision of 4 decimals of milliseconds), when the NSDate doesn't. Is this an issue (it could potentially mean that something happen a second earlier/later then expected)?
I'm using Swift-SMART version 4.2.0