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
3
votes
0 answers

EKEventStore events startDate timezone

I want to load events from local phone calendar. Here is the code: @IBAction func btnpressed() { let eventStore = EKEventStore() switch EKEventStore.authorizationStatusForEntityType(EKEntityTypeEvent) { case .Authorized: …
mkz
  • 2,302
  • 2
  • 30
  • 43
3
votes
3 answers

I am getting wrong notification time in iOS?

i am little bit new at iPhone application development.So at first sorry from my side if it is a lame question.Now my question is.In my app user has dial of clock where he will select hour and minute.using that hour and minute i want to set alarm for…
Emon
  • 452
  • 3
  • 11
  • 21
3
votes
1 answer

Timezones on Windows and Mac

I'm wondering what the easiest method would be to reconcile timezones between Windows and OSx? I've tried listing out all the time zones windows could support and trying to cross reference a list of what OSx could support. I'm going to be given an…
Justin T. Watts
  • 547
  • 1
  • 4
  • 16
3
votes
2 answers

Compare iOS Time Zone Rules

If the user is in Eastern time, I don't want to display "EST" or "EDT" but if they are not, I do want to display it. Is there an easy way to compare TimeZone rules in iOS? [NSTimeZone localTimeZone] returns America/Indianapolis, but I just want to…
dewyze
  • 979
  • 1
  • 7
  • 21
3
votes
5 answers

Convert GMT time to local time

I got current GMT time - 2013-05-15 08:55 AM my current local time is - 2013-05-15 02:06 PM and time zone is - Asia/Kolkata I tried to convert the above GMT to my local time with this code NSTimeZone* sourceTimeZone = [NSTimeZone…
user2210755
3
votes
1 answer

How to calculate the time difference between two locations

I am having a problem with calculating time difference between two timeZones. If I am at location A I know the latitude and longitude and the current time. I go to location B I know the latitude and longitude and the current time. How to calculate…
Sneha
  • 1,444
  • 15
  • 24
3
votes
1 answer

How to get localized city and country names for timezone name

How can I get city name and country name from timezone? For example, I can see all knownTimeZoneNames array, and I want to show in labels "Europe/Moscow" as "Moscow, Russia" in few languages. How can I get this strings? Actually I need localized…
3
votes
1 answer

NSCalendar currentCalendar setTimeZone not setting

If I try and set the time zone arbitrarily from anywhere within the app using the following : [[NSCalendar currentCalendar] setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"EST"]]; NSTimeZone *tz = [[NSCalendar currentCalendar]…
Michael
  • 3,269
  • 2
  • 23
  • 16
2
votes
2 answers

NSTimezone not giving GMT+ or GMT- formate iphone?

I am getting total number of seconds for the timezone but not getting it is ahead of GMT Or behind to GMT. Here is my code. NSDate *sourceDate = [NSDate dateWithTimeIntervalSinceNow:3600 * 24 * 60]; NSTimeZone* destinationTimeZone = [NSTimeZone…
Viral Narshana
  • 1,855
  • 2
  • 21
  • 45
2
votes
1 answer

How can I get GNU Lib C TZ format output from NSTimeZone?

I need to set the timezone information of a remote clock to the one on the iOS device. The remote clock only supports GNU lib C TZ format of: std offset dst [offset],start[/time],end[/time] e.g: EST+5EDT,M3.2.0/2,M11.1.0/2 So I need to produce a…
MandoMando
  • 5,215
  • 4
  • 28
  • 35
2
votes
1 answer

Getting timezone abbreviations in Swift

I am trying to retrieve the timezone abbreviations of the local time zone by using the following code. private func getLocalTimezone() -> String { guard let localTimezone = TimeZone.current.abbreviation() else { return "" } return…
Sree
  • 23
  • 1
  • 6
2
votes
1 answer

Time of the event based on event or user's current timezone?

I am developing a Calendar app where user can select whether he want to auto move the event time based on current timezone or set it as unchanged based on switch button. I am using Eventkit for storing the events and also UILocalnotification for…
Hardroid
  • 51
  • 6
2
votes
2 answers

Getting timezone information on iPhone for coordinates

For iPhone development: How can I get the timezone and DST information for any place given that I only have geographic coordinates. (NSTimezone does not have any such method)
Asad Qamber
  • 102
  • 11
2
votes
3 answers

NSTimeZone initialisation results in "unable to read data"

I'm trying to initialise an NSTimeZone object like this: var timezone = NSTimeZone.init(name: "Europe/Moscow") instead of nil or a legit locale value - I get "unable to read data" in xCode's debugging tool I got the timezone string…
David Schmoecker
  • 567
  • 3
  • 8
  • 17
2
votes
1 answer

extract NSTimeZone from string like '+-hh:mm'

In my app I download some data as JSON from an API which contains an entry with local time: "local_date" : "2015-07-08T13:18:14+02:00" The JSON data are parsed into an NSDictionary* information: NSDateFormatter* dateFormatter= [NSDateFormatter…
donmarkusi
  • 346
  • 2
  • 13