SWIFT Standards works with the user community to specify and publish Market Practice - rules and best-practice advice on how standards should be deployed to meet particular business needs or to comply with regulation. The SWIFT Standards group maintains several important message standards. Overview SwiftDate exposes several convenient functions to print (and parse, of course) dates and time intervals as strings: as custom string defined by tr35-31format; for example 'yyyy-MM-dd'for '2015-01-05' as ISO8601strings with all available sub specs.

  1. Swift Date Formatting
  2. Swift Date Formats
Swift Date Formats

Working with NSDate, NSDateFormatter, and NSDateComponents can be a little convoluted, so I’ve created myself a cheat sheet that will be updated as I discover new tips and tricks in this realm.

The new cheat sheet can be found over at GitHub in the form of an Xcode Playground:

  • Swift Dates Cheat Sheet Playground

Topics that are included in the Playground are as follows:

  • Getting today’s date
  • Converting NSDate to String
  • Converting String to NSDate
  • Getting components of an NSDate
  • Setting components of an NSDate
  • Creating new NSDate instances from NSDateComponent instances

The best way to view this cheat sheet is by downloading the playground from GitHub, but here’s a straight copy-paste from the repo in case you just want to copy and paste it into a playground of your own from here:

  • Parse PFCloud – “JSON text did not start with array or object”
  • Working with Swift: Adopt a Protocol or Pass a Function?
  • Listing Calendar Events with Event Kit and Swift
  • Adding Buttons to the Navigation Bar with Storyboards
  • FIX – Query in Parse Cloud Code Returns Unauthorized Error
Please enable JavaScript to view the comments powered by Disqus.comments powered by Disqus

Working with NSDate, NSDateFormatter, and NSDateComponents can be a little convoluted, so I’ve created myself a cheat sheet that will be updated as I discover new tips and tricks in this realm.

The new cheat sheet can be found over at GitHub in the form of an Xcode Playground:

Swift date formats
  • Swift Dates Cheat Sheet Playground

Topics that are included in the Playground are as follows:

  • Getting today’s date
  • Converting NSDate to String
  • Converting String to NSDate
  • Getting components of an NSDate
  • Setting components of an NSDate
  • Creating new NSDate instances from NSDateComponent instances
Swift Date Formats

The best way to view this cheat sheet is by downloading the playground from GitHub, but here’s a straight copy-paste from the repo in case you just want to copy and paste it into a playground of your own from here:

Swift Date Formatting

  • Parse PFCloud – “JSON text did not start with array or object”
  • Working with Swift: Adopt a Protocol or Pass a Function?
  • Listing Calendar Events with Event Kit and Swift
  • Adding Buttons to the Navigation Bar with Storyboards
  • FIX – Query in Parse Cloud Code Returns Unauthorized Error
Please enable JavaScript to view the comments powered by Disqus.comments powered by Swift

Swift Date Formats

Disqus