ISO 8601 Date Formatter in Objective for iPhone not setting offset correctly -
thank in advance help.
i trying create iso 8601 date formatter iphone application , can not offset come out correctly. need result time zone in gmt , located in est , when tested @ 2:33 pm march 6th 2012 got 2012-03-06t14:33:35+0000
due zone difference need -05:00 show instead of +0000
the code using is:
nsdateformatter* dateformatter = [[nsdateformatter alloc] init]; [dateformatter setdateformat:@"yyyy-mm-dd't'hh:mm:ss zz"]; nstimezone *gmt = [nstimezone timezonewithabbreviation:@"gmt"]; [dateformatter settimezone:gmt]; nnsdate *gmtdate = [[nsdate alloc] init]; datestring = [dateformatter stringfromdate:gmtdate]; nslog(@"date string: %@", datestring);
have tried setting time zone est? give -0500
Comments
Post a Comment