Avatar
Avatar
Iceman
@swift-5.6.3 import Foundation let dateS = "2022-03-08T15:00:00.000Z" let f = ISO8601DateFormatter() var c = Calendar(identifier: .gregorian) // c.timeZone = .init(secondsFromGMT: 9 * 3600)! let todayDay = c.component(.day, from: f.date(from: dateS)!) print(todayDay)
swift56 BOT 3/9/2022 7:23 AM
exit status: 132 with stderr:main/<stdin>:9: Fatal error: Unexpectedly found nil while unwrapping an Optional value Current stack trace: 0 libswiftCore.so 0x00007f29a022e920 _swift_stdlib_reportFatalErrorInFile + 112 1 libswiftCore.so 0x00007f299ff262f1 <unavailable> + 1417969 2 libswiftCore.so 0x00007f299ff26016 <unavailable> + 1417238 3 libswiftCore.so 0x00007f299ff25e0a <unavailable> + 1416714 4 libswiftCore.so 0x00007f299ff25840 _assertionFailure(_:_:file:line:flags:) + 315 6 swift-frontend 0x000000000068ff2a <unavailable> + 2686762 7 swift-frontend 0x0000000000547e4c <unavailable> + 1343052 8 swift-frontend 0x0000000000509396 <unavailable> + 1086358 9 swift-frontend 0x0000000000508a90 <unavailable> + 1084048 10 swift-frontend 0x00000000004fd2a4 <unavailable> + 1036964 11 swift-frontend 0x00000000004b3814 <unavailable> + 735252 12 libc.so.6 0x00007f299e867ba0 __libc_start_main + 231 13 swift-frontend 0x00000000004b326a <unavailable> + 733802 Stack dump: 0. Program arguments: /usr/bin/swift-frontend -frontend -interpret - -disable-objc-interop -new-driver-path /usr/bin/swift-driver -resource-dir /usr/lib/swift -module-name main 1. Swift version 5.6-dev (LLVM 016ddf3ba9bf6cf, Swift a43b04fe3d5feea) 2. Compiling with the current language version 3. While running user code "<stdin>" Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it): /usr/bin/swift-frontend[0x5fa5993] /usr/bin/swift-frontend[0x5fa353e] /usr/bin/swift-frontend[0x5fa5d26] /lib/x86_64-linux-gnu/libpthread.so.0(+0x12980)[0x7f29a05f9980] /usr/lib/swift/linux/libswiftCore.so(+0x15a2f5)[0x7f299ff262f5] /usr/lib/swift/l