mirror of
https://github.com/linagora/tmail-flutter.git
synced 2026-12-05 16:08:46 +00:00
13 lines
340 B
Swift
13 lines
340 B
Swift
import Foundation
|
|
|
|
extension String {
|
|
func convertISO8601StringToDate() -> Date? {
|
|
let dateFormatter = ISO8601DateFormatter()
|
|
dateFormatter.formatOptions = [.withInternetDateTime, .withFractionalSeconds]
|
|
if let date = dateFormatter.date(from: self) {
|
|
return date
|
|
}
|
|
return nil
|
|
}
|
|
}
|