One Quickie


Today's date as a string (NSString->General)
The general solution for converting a date to a string is NSDateFormatter. Sometimes you need to generate a date string in a particular format easily. For instance if you need "December 4, 2007", you can use:
[[NSDate date] descriptionWithCalendarFormat: @"%B %e, %Y" timeZone: nil locale: nil]
(Thanks to Mike Morton for this one)
(Also Mac OS X only)



borkware home | products | miniblog | rants | quickies | cocoaheads
Advanced Mac OS X Programming book

webmonster@borkware.com