Avatar
@swift-6.0.3 import Foundation let text = "2024-12-03T15:28:23.934 +09:00" let timestampFormat = Date.ISO8601FormatStyle(includingFractionalSeconds: true) let formatter = ISO8601DateFormatter() formatter.formatOptions.insert(.withFractionalSeconds) print(try? Date(text, strategy: timestampFormat)) print(formatter.date(from: text)) (edited)