Date Formatting on iPhone and Cocoa


/ Published in: Objective C
Save to your folder(s)

iPhone uses [LDML standard](http://unicode.org/reports/tr35/tr35-4.html#DateFormatPatterns)
for date formatting


Copy this code and paste it in your HTML
  1. //Format Date
  2. NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
  3. [dateFormat setDateFormat: @"yyyy-MM-dd HH:mm:ss zzz"]; // 2009-02-01 19:50:41 PST
  4. NSString *dateString = [dateFormat stringFromDate: [scoreData objectForKey: @"date"]];

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.