diff options
Diffstat (limited to 'Map/Core Extensions/Date+format.swift')
| -rw-r--r-- | Map/Core Extensions/Date+format.swift | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Map/Core Extensions/Date+format.swift b/Map/Core Extensions/Date+format.swift new file mode 100644 index 0000000..d29ed0f --- /dev/null +++ b/Map/Core Extensions/Date+format.swift @@ -0,0 +1,17 @@ +// +// Date+format.swift +// Map +// +// Created by Ruben Beltran del Rio on 2/1/21. +// + +import Foundation + +extension Date { + func format() -> String { + let formatter = DateFormatter() + formatter.dateStyle = .short + formatter.timeStyle = .medium + return formatter.string(from: self) + } +} |