ios - Date formatter for the google calender API -


this question has answer here:

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:

date formatter guide


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -