Questions tagged [nstimezone]

Time Zone data for iOS and Mac OS X

NSTimeZone is a class that presents IANA time zone data as an Objective-C () class. It's part of the Foundation framework () on Mac OS X () and iOS () and in Cocotron and GNUStep.

255 questions
-1
votes
3 answers

what is the reason for one day delay in date value?

below is my sample code. NSDateFormatter * dateFormatter = [[NSDateFormatter alloc]init]; [dateFormatter setDateFormat:@"yyyy-MM-dd"]; NSDate * dateFormatted = [dateFormatter dateFromString:@"2016-01-17"]; NSLog(@"Date :…
Baskar
  • 33
  • 6
-1
votes
2 answers

Current Time in Date format shows wrong - ios

I am doing a prayer alarm app and i want to compare my current time with fetched time, but when i am getting my current time, it has some time difference always as shown; // getting today's date string NSDate *today = [NSDate date]; …
Mumthezir VP
  • 6,251
  • 6
  • 28
  • 57
-1
votes
4 answers

Issues in converting date string (any time zone) to NSDate of French Time Zone

I want to convert a date string (can be in any time zone) to a date in French Time Zone. I am using following code. NSString * dateString = @"27/05/2015 - 19:00" // system time zone is GMT +5 NSDateFormatter* frenchDateFormatter = [[NSDateFormatter…
Muhammad Irfan
  • 280
  • 3
  • 17
-1
votes
1 answer

User timezone issues

My app was working fine until the changing of the clocks this morning. I set the user's timezone using the following code. let usersTimeZone: String = ltzAbbrev() var gregorian: NSCalendar = NSCalendar(calendarIdentifier:…
Tom
  • 790
  • 2
  • 9
  • 32
-1
votes
2 answers

how to convert Uk time to Mexico time zone

I am having an array in that date are in UK time zone. I want to convert that UK time zone to below country time. I am having two radio button Mexico (UTC-6) India - IST (UTC+5.30) when i click Mexico (UTC-6) radio button my array date are convert…
Gowtham K
  • 75
  • 2
  • 9
-1
votes
1 answer

Converting EDT time to Local Time in Objective C

In my project , we have a requirement to convert the server sent time (EDT) to local time and display on UI . I have written the below code which seems to be working perfectly fine in simulator but ,it displays as blank on device . Due to the…
Rango
  • 71
  • 8
-1
votes
1 answer

NSDate show wrong date with NSTimezone

Hi I am trying to display GMT time to my device time. my device time zone is EDT. I got the GMT time as a string // GMT Time-----2014-11-27 19:32:00 NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.dateFormat…
-1
votes
1 answer

NSDateFormatter return Date in GMT specific timezone

I want to get the date and time in a specific time zone. I am getting most of the things right but just at the end when i get the date from NSString using NSDateFormatter method it returns me the date in the GMT specific time zone. The method…
Abdul Samad
  • 5,748
  • 17
  • 56
  • 70
-1
votes
1 answer

GMT+5:30 to NSTimeZoneName String

I have a string GTM+5:30 and i want its related time zone name example: Asia/Kolkata Is there a possible way to get it. NSTimeZone* localTimeZone = [NSTimeZone timeZoneWithAbbreviation:@"GMT+5:30"]; NSLog(@"Name: %@",localTimeZone.name); this…
-1
votes
1 answer

NSDate differs with different timezones in iOS

I have a calendar app, in which I highlight current date, I have followed the following steps, at present my device time is 11:59 am, Indian time zone, I change it to first 9.am, then I change time zone to san jose , I get time as 25th june 9.34…
Ranjit
  • 4,576
  • 11
  • 62
  • 121
-2
votes
2 answers

Getting one hour difference on date

Following is the code I am writing to convert UTC time to local time : NSDateFormatter *dateFormatter1 = [[NSDateFormatter alloc] init]; [dateFormatter1 setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss"]; NSLocale *locale = [[NSLocale alloc]…
Nitish
  • 13,845
  • 28
  • 135
  • 263
-2
votes
3 answers

need to get central time in objective-c

I have app where i need to get the current time (CST). I'm trying to use the following code but the NDate is the same as GMT: NSDate* date = [NSDate date]; NSLog(@"Time is %@", [date description]); [NSTimeZone setDefaultTimeZone:[NSTimeZone…
Dameon Bryant
  • 39
  • 1
  • 6
-2
votes
5 answers

Issue in coverting GMT time to Local time

My current Device time is --- 2013-05-09 10:23 AM I convert it int GMT with following code NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; dateFormatter.dateFormat = @"yyyy-MM-dd HH:mm a"; NSTimeZone *gmt = [NSTimeZone…
-2
votes
1 answer

Converting string with 12 hour time format into NSDate

I need to change string that is in 12 hour time format into NSDate. I am using below given code but its returning null. Can anyone help me with this?? NSString = @"04/03/2013 7pm"; NSDateFormatter *df = [[NSDateFormatter alloc]init]; [df…
-2
votes
1 answer

Weird timezone issue with Tapku library

I have a strange issue with Tapku Calendar control library. It was showing me wrong date information, so I replaced all timezones from [NSTimeZone timeZoneForSecondsFromGMT:0] to [NSTimeZone systemTimeZone]]; All works well till here. However,…
iOSDev
  • 3,617
  • 10
  • 51
  • 91
1 2 3
16
17