Language:

Date Formatting in Cocoa

Common Format Strings

Year (full)

yearFormatter.dateFormat = @"y"; yearFormatter.dateFormat = "y"

Year (two digits, leading zero if less than ten)

yearFormatter.dateFormat = @"yy"; yearFormatter.dateFormat = "yy"

Quarter (abbreviated)

quarterFormatter.dateFormat = @"qqq"; quarterFormatter.dateFormat = "qqq"

Month (two digits, leading zero where applicable)

monthFormatter.dateFormat = @"MM"; monthFormatter.dateFormat = "MM"

Month (abbreviated)

monthFormatter.dateFormat = @"MMM"; monthFormatter.dateFormat = "MMM"

Month (full)

monthFormatter.dateFormat = @"MMMM"; monthFormatter.dateFormat = "MMMM"

Day of Month (no leading zero)

dateFormatter.dateFormat = @"d"; dateFormatter.dateFormat = "d"

Day of Week (abbreviated)

weekDayFormatter.dateFormat = @"EEE"; weekDayFormatter.dateFormat = "EEE"

Day of Week (full)

weekDayFormatter.dateFormat = @"EEEE"; weekDayFormatter.dateFormat = "EEEE"

Day of Week (short)

weekDayFormatter.dateFormat = @"EEEEEE"; weekDayFormatter.dateFormat = "EEEEEE"

Period (AM/PM)

periodFormatter.dateFormat = @"a"; periodFormatter.dateFormat = "a"

Hour (0-12, zero-padded)

hourFormatter.dateFormat = @"hh"; hourFormatter.dateFormat = "hh"

Hour (0-12, not zero-padded)

hourFormatter.dateFormat = @"h"; hourFormatter.dateFormat = "h"

Hour (0-23, zero-padded)

hourFormatter.dateFormat = @"HH"; hourFormatter.dateFormat = "HH"

Hour (0-23, not zero-padded)

hourFormatter.dateFormat = @"H"; hourFormatter.dateFormat = "H"

Minute (zero-padded)

minuteFormatter.dateFormat = @"mm"; minuteFormatter.dateFormat = "mm"

Second (zero-padded)

secondFormatter.dateFormat = @"ss"; secondFormatter.dateFormat = "ss"

Time Zones

Specific Non-Location Format (Short, ex. "PDT")

zoneFormatter.dateFormat = @"zzz"; zoneFormatter.dateFormat = "zzz"

Specific Non-Location Format (Long, ex. "Pacific Daylight Time")

zoneFormatter.dateFormat = @"zzzz"; zoneFormatter.dateFormat = "zzzz"

Localized GMT Format (Long, ex. "GMT-6:00")

zoneFormatter.dateFormat = @"ZZZZ"; zoneFormatter.dateFormat = "ZZZZ"

Generic Non-Location Format (Short, ex. "PT")

zoneFormatter.dateFormat = @"v"; zoneFormatter.dateFormat = "v"

Generic Non-Location Format (Long, ex. "Pacific Time")

zoneFormatter.dateFormat = @"vvvv"; zoneFormatter.dateFormat = "vvvv"

Exemplar City Name (ex. "Chicago")

zoneFormatter.dateFormat = @"VVV"; zoneFormatter.dateFormat = "VVV"

Other Goodies

en_US_POSIX Locale (prevents user settings from changing format string)

dateFormatter.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"]; dateFormatter.locale = NSLocale(localeIdentifier: "en_US_POSIX")

ISO 8601 Date

dateFormatter.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"UTC"]; dateFormatter.dateFormat = @"yyyy-MM-dd'T'HH:mm:ss'Z'"; dateFormatter.timeZone = NSTimeZone(abbreviation: "UTC") dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss'Z'"

GMT Date

dateFormatter.dateFormat = @"eee, dd MMM yyyy HH:mm:ss zzz"; dateFormatter.dateFormat = "eee, dd MMM yyyy HH:mm:ss zzz"

Twitter API Date

dateFormatter.dateFormat = @"eee MMM dd HH:mm:ss ZZZZ yyyy"; dateFormatter.dateFormat = "eee MMM dd HH:mm:ss ZZZZ yyyy"

Not Listed?

This site is not intended to be an exhaustive list of all possible formatting instances.
If you find yourself needing syntax not listed here, please check Apple's date formatting guide or the table made just for this.