objective c - NSDate date method returns wrong result -
i know there lot of questions of type, did't find solution case; need current , correct nsdate object, not nsstring ! code returns wrong time (+3 hours), because i'm ukraine. nsdate *currentdate = [nsdate date]; how current nsdate object nsdateformatter ? know how nsstring , don't need it. edit: i'm using code compare 2 nsdates using nscalendar object, here code: nscalendar *calendar = [nscalendar currentcalendar]; nsuinteger unitflags = nsdaycalendarunit | nshourcalendarunit | nsminutecalendarunit | nssecondcalendarunit; nsdatecomponents *components = [calendar components:unitflags fromdate:nowdate todate:enddate options:0]; and components.hour shows me +3 hours difference nsdates stored in utc, dates itselfs dont know timezones or weeks, month, years. point in time. to see correct time position on earth surface, need take nscalendar, represents time model in account. use directly , mess around dates, or create nsdateformatter leave date...