Xcode 12 showing nil for a valid optional Date? field

Here is a code snippet:

Code Block
let dateFormatter = DateFormatter()
dateFormatter.locale = Locale(identifier: "en_US_POSIX")
dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ"
dateFormatter.timeZone = TimeZone(secondsFromGMT: 0)
let dateString = "2020-09-17T15:59:23Z"
let date = dateFormatter.date(from: dateString)
print(date)


with a breakpoint on the last line,

Code Block
(lldb) p date
(Date?) $R0 = nil
(lldb) po date
▿ Optional<Date>
  ▿ some : 2020-09-17 15:59:23 +0000
    - timeIntervalSinceReferenceDate : 622051163.0
(lldb) 


It looks like variable view is showing the same issue. I'll be filing a bug shortly. Does anyone know a work around?

Replies

FB8711432
Post not yet marked as solved Up vote reply of tdc Down vote reply of tdc