NSDate - Zero Out Seconds
I recently had a scenario where I was getting the current date using:
Now in many scenarios, this code will work perfectly, but the issue I had was I was performing some quite advanced calculations on the date, and the date contained a value for seconds, which threw my calculations off a little, because I hadn't factored seconds into my equations. The following code, when passed a NSDate object will 'zero' out the second value, leaving you with an absolute value;