Skip to main content

Working on formatting the date in Xcode, and you come across the situation where you need to check or test the date format.  NSDateFormatter is a great site to check your date format string.  I wanted to transform the 2019-08-15 10:34:49+1000 to Aug 15, 12:34 AM.

let dateFormatter = DateFormatter()

dateFormatter.dateFormat = "MMM d, h:mm a"

let dateFormatted = dateFormatter.string(from: run.timestamp!)

dateFormatted prints Aug 15, 12:34 AM

Related articles

Andrew Fletcher29 Sep 2023
Setting up an ionic app
Recently a client handed me code that runs an app through iOS and Android.  No details about whether native or otherwise.  Once I had the opportunity to crawl through the code, definitely not native.  Typescript, Angular, Cordova... etc.Glancing at the modification dates, the last...
Andrew Fletcher02 Aug 2023
Android Studio error when running app through emulator
Only a month ago, running an app through the Android Studio emulator was running fine.  Now I'm warmly greeted byError Installation did not succeed. The application could not be installed: INSTALL_PARSE_FAILED_NO_CERTIFICATESThe complete error is Launching '{project}' on Pixel 5 API...
Andrew Fletcher22 Aug 2022
Android releasing app issues
Warning from Google Play Store when uploading an App You must complete the advertising ID declaration before you can release an app that targets Android 13 (API 33). We'll use this declaration to provide safeguards in Play Console to accommodate changes to advertising ID in Android 13. Apps...