NSTimeInterval interval = (double)dateInLong;
NSDate *theDate = [[NSDate alloc]initWithTimeIntervalSince1970: interval];
Then, create a date formatter:
dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"MMM' 'dd','yyyy' 'h':'mm':'ss' 'a"];
NSString *theDateStr = [dateFormatter stringFromDate: theDate];
Date format:
MMM: Short form of month spelt out (e.g. Jan, Feb, Mar)
dd: Day, with 0 in front if less than 10
yyyy: Year (4 digit)
h: Hour, without 0 in front if less than 10
mm: minute
ss: second
a: AM/PM
Great thoughts you got there, believe I may possibly try just some of it throughout my daily life.
ReplyDeleteFormatting Journal