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
2
votes
1 answer

Errors in NSTimeZone secondsFromGMTForDate?

I'm writing an application that involves people's birth times, and I'm attempting to use IOS to get the accurate GMT offset. I'm getting what are clearly wrong answers, and I wonder whether others have encountered them, or if there are any…
Apollo Grace
  • 361
  • 3
  • 16
2
votes
4 answers

How to show timezone abbreviation with the date

I am getting a time in UTC and want to append timezone abbreviation with it. I have the below code to get the timezone abbreviation but it is giving as GMT +5.30. I want as IST. For America it is giving as EDT, I need for all the timezones to give…
Jassi
  • 537
  • 8
  • 21
2
votes
1 answer

Update iOS app timezone while it is running

I want to update the timezone of my iOS app while its running. I want to update the timezone when user change region from the "Settings" app "Settings->General->Language & Region->Region". I am receiving region change notification using and…
Saurabh Shukla
  • 1,368
  • 3
  • 14
  • 26
2
votes
0 answers

How to calculate NStimeZone differences

Currently I am trying to sync up time with server time. Currently I am in India(IST) getting time zone and converting into GMT format and calculating timeStamp and finding delta value with server time and using that timestamp .. thats working fine..…
venkipar
  • 141
  • 1
  • 2
  • 7
2
votes
1 answer

How to obtain NSCalendarComponent values relative to time zone other than GMT?

Why do the following marked assertions fail? I was just running this unit test on a host in Central Europe. Hence NSCalendar.currentCalendar.timeZone is CEST, i.e. GMT+0200. NSDateComponents returns this time zone but its other values (for year,…
Drux
  • 11,992
  • 13
  • 66
  • 116
2
votes
2 answers

How to manage NSDate for different timezones

I have created a calendar in my app, using the date object this way: NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *weekdayComponents = [gregorian components:(NSDayCalendarUnit…
Ranjit
  • 4,576
  • 11
  • 62
  • 121
2
votes
1 answer

Iphone date format

I was trying to format a time from GMT+7 to GMT+3: I am building an app with a world clock in specific country (the user will be at the GMT+7and I want to represent the GMT+3 time ) NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; …
Roy
  • 105
  • 5
2
votes
1 answer

UILocalNotification - Fire at 6:00am in every time zone

I'm having trouble getting my head around time zones and can't seem to solve it. The user should enter a time for an alarm to go off. So they choose 6:00am Sunday (using a pickerView) while in Sydney Australia's time zone. Then when their device…
2
votes
2 answers

iOS Development - Associating a city with a NSTimezone Offline

Hope your all doing well. So I am in the process of developing a timezone iOS application. The application requires that we have a list of high population cities, and that when a user selects one, it determines the Olson Timezone ID necessary for…
Nebjezus
  • 41
  • 3
2
votes
3 answers

Convert iOS localTimeZone to a knownTimeZone

Using NSTimeZone the list of knownTimeZoneNames does not match the timezone retrieved by localTimeZone. How can I convert a timezone from localTimeZone to a time zone from knownTimeZoneNames. More specifically, the timezone .name return value must…
Awesome-o
  • 2,002
  • 1
  • 26
  • 38
2
votes
2 answers

NSTimeZone values and locale

I've got Time Zone: Central European Summer Time in OS X (automatically based on location). When running my code on simulator I'm getting these results: NSTimeZone *tz = [NSTimeZone localTimeZone]; // Gives me Local Time Zone (Europe/Warsaw (CEST)…
rafek
  • 5,464
  • 13
  • 58
  • 72
2
votes
2 answers

iPhone NSTimeZone: localTimeZone confusion

From what I understand, calling NSLog(@"Local Time Zone %@",[[NSTimeZone localTimeZone] name]); gives you the local time zone of the device. What it's giving me is "US/Central", and I can't find that anywhere in the list of abbreviations in…
Richard
  • 23
  • 1
  • 5
2
votes
2 answers

Change language for NSDate weekday and month

I want to display a date like this : weekday 7 month. I did this and I have the correct syntax. NSDateFormatter* df = [[NSDateFormatter alloc] init]; [df setDateFormat:@"EEEE dd MMMM"]; [df setTimeZone:[NSTimeZone localTimeZone]]; The result logged…
Seb
  • 545
  • 9
  • 29
2
votes
3 answers

How to get the time zone name for a CLLocation

I have an application that uses a CLGeocoder to forwardGeocode a placemark from an address string. The CLPlacemark response contains a CLLocation which gives me GPS coordinates. The only way to create an NSTimeZone seems to be by using the correct…
Joshua
  • 709
  • 2
  • 10
  • 23
1
vote
2 answers

Not able to set NSTimeZone to a required format

I have a TimeZone as NSString value given as "GMT-09:00". All I want is to setup my NSTimeZone with this format. I tried but wasn't able to do this. This time may vary every time so i can't set it as static in the method eg. i can't do this -- …
mayuur
  • 4,736
  • 4
  • 30
  • 65