Date Formatting on iPhone and Cocoa


 / Published in: Objective C
 

iPhone uses LDML standard for date formatting

  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  

You need to login to post a comment.