ios - Nil response when formatting date -
Here's my server time:
2014-08-20 16:23: 00.0
Now I would like to format the date that my server only gives me the date, and not the time. For example: Can the month / date / year tell someone what I am doing?
Whatever I have tried here:
NSDate * date = [[NSDate alloc] init]; NSDateFormatter * formatter = [[NSDateFormatter alloc] init]; [Format setDateFormat: @ "yyyy-dd-MM HH: mm: SS"]; NSString * dateForShow = // 2014-08-20 16:23: 00.0 / Date Date Zero Date = [Date of Date Framestrings: DateForn]; [Formatter setDateFormat: @ "MM-dd-yyyy"]; NSString * Result = [Formatter string string: date];
Try this for your third line:
[Format setDateFormat: @ "yyyy-MM-dd HH: mm: SS"];
Reference:
Comments
Post a Comment