ios - Date formatter for the google calender API -
this question has answer here:
- converting nsstring nsdate (and again) 16 answers
1) getting date google calender. format 2013-05-03t22:30:00.000+02:00 this. date format used type of date in app.
2) have show date format feb 4th 2013 .
how implement these 2 features in app? please me.
thank you.
to nsdate string:
nsdateformatter *dateformat = [[nsdateformatter alloc] init]; [dateformat setdateformat:@"yyyy-mm-dd't'hh:mm:ss.sss z"]; nsdate *mydate = [dateformat datefromstring:@"2013-05-03t22:30:00.000+02:00"];
once have nsdate, can same representation:
nsdateformatter *dateformat = [[nsdateformatter alloc] init]; [dateformat setdateformat:"mmm d yyyy"]; nsstring *mystring = [mydate stringfromdate:mydate];
you can consult whole date formatting options here:
Comments
Post a Comment