iphone - Date object is showing date with minus 5:30hr when compare to current time. -
this question has answer here:
- getting date [nsdate date] off few hours 3 answers
when create object nsdate , put cursor on object showing currect date below
and when trying log object showing date minus 5:30hr below

and when add offset date , put cursor on object showing date plus 5:30hr below
nsinteger offset = [[nstimezone defaulttimezone] secondsfromgmt]; 
and when trying log object showing exact date below

why happening this? problem timezone? in advance.
nsdate comes gmt. have format date per required timezone.. can set device timezone or can use calendar set timezone..
Comments
Post a Comment