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 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...
Andrew Fletcher22 Aug 2022
Version code 1 has already been used. Try another version code
Uploading a new version of an Android app to Google Play and I'm seeing this error Version code 1 has already been used. Try another version code. There are three areas to observe: Version Code: {whole integer} Version Name: {String} Version Name Suffix: {Integer} Currently, my...