Posted By

code4mac on 10/25/12


NSDate NSDateFormatter

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Your own NSDateFormatter

 / Published in: Objective C

Create your own NSDateFormatter

  1. NSDate *today = [[NSDate alloc] init];
  2. NSDateFormatter *forIdPeriodFormatterStyle = [[NSDateFormatter alloc] init];[forIdPeriodFormatterStyle setDateFormat:@"yyyyMMdd"];//you can add HH and mm
  3. NSString *idPeriodString = [forIdPeriodFormatterStyle stringFromDate:today];

Report this snippet  

You need to login to post a comment.