Returns a string representation of the date formatted as specified by given conversion specifiers.
The format for the returned string (see Date and Number Formatters in OS X v10.0 to 10.3 for a discussion of how to create the format string). Pass nil to use the default format string, “%Y-%m-%d %H:%M:%S %z” (this conforms to the international format YYYY-MM-DD HH:MM:SS ±HHMM.)
The time zone in which to represent the receiver. Pass nil to use the default time zone—specific to the current locale.
An NSDictionary object containing locale data. To use the user's preferences, you can use [[NSUserDefaults standardUserDefaults] dictionaryRepresentation].
If you pass nil or an instance of NSLocale, NSDate uses the system default locale—this is not the same as the current user's locale.
A string representation of the receiver, formatted as specified by the given conversion specifiers.
There are several problems with the implementation of this method that cannot be fixed for compatibility reasons. To format a date, you should use a date formatter object instead (see DateFormatter and Data Formatting Guide).
You could use this method to print the current time as follows: