Created
March 16, 2023 10:08
-
-
Save likil33/a3144310920f21bae2b03974294e5ae1 to your computer and use it in GitHub Desktop.
DateFormat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func dateSetup(_ dateStr:String) -> String { | |
| let formatter = DateFormatter() | |
| formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ" | |
| let dateString = formatter.date(from: dateStr) | |
| formatter.dateFormat = "MM-dd-yyyy" | |
| return formatter.string(from: dateString ?? Date()) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment