DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

IPhone Date Formatting

  • submit to reddit
        // iPhone uses LDML standard for date formatting:
	//Format Date
	NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
	[dateFormat setDateFormat: @"yyyy-MM-dd HH:mm:ss zzz"]; // 2009-02-01 19:50:41 PST
	NSString *dateString = [dateFormat stringFromDate: [scoreData objectForKey: @"date"]];