• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSTimezone and offset
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTimezone and offset


  • Subject: NSTimezone and offset
  • From: Lorenzo Thurman <email@hidden>
  • Date: Wed, 04 Sep 2013 23:21:03 -0500

Im working with NSTimezone and I need to get the current timezone offset, but I'm finding this more difficult than I think it should be. I thought it might just  be the way I'm looking at things, but I don't think so.

If create an NSTimezone object and then send that object a daylightSavingTimeOffset message, I get back, for Chicago, 3600. This is wrong, at least for my purposes, for two reasons:
1) The offset should negative.
2) Chicago is currently observing DST

The value I would expect to see returned should be -3000. I get why the value 3600 is correct at least with respect to the magnitude, as I can see I have this link setup for my system:
/etc/localtime -> /usr/share/zoneinfo/America/Chicago

But, why is it not negative? How do I get the correct offset.
TIA
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTimezone and offset
      • From: email@hidden
  • Prev by Date: Re: Subclassing a View Controller in a Storyboard
  • Next by Date: Re: NSTimezone and offset
  • Previous by thread: Re: iOS Deleting an Entity from Core Data
  • Next by thread: Re: NSTimezone and offset
  • Index(es):
    • Date
    • Thread