• 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
How to get the time zone of a parsed date/time string?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to get the time zone of a parsed date/time string?


  • Subject: How to get the time zone of a parsed date/time string?
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 30 Jul 2014 11:24:37 -0700

After NSDateFormatter parses a date string that includes a time zone, how can the caller determine the time zone? The result is an NSDate object, which is simply a timestamp with no notion of time zone.

For example, how does one determine from the string "Wed, 30 Jul 2014 08:21:35 -0700” that the time zone is GMT-7:00?

(IIRC, in the olden days NSDateFormatter would return an NSCalendarDate object, which did have a timeZone property, but no more.)

—Jens
_______________________________________________

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: How to get the time zone of a parsed date/time string?
      • From: Keary Suska <email@hidden>
    • Re: How to get the time zone of a parsed date/time string?
      • From: Chuck Soper <email@hidden>
    • Re: How to get the time zone of a parsed date/time string?
      • From: Alex Zavatone <email@hidden>
  • Prev by Date: Re: How to constrain a UISlider in a UIToolbar?
  • Next by Date: Re: How to get the time zone of a parsed date/time string?
  • Previous by thread: Auto-Layout Strangeness
  • Next by thread: Re: How to get the time zone of a parsed date/time string?
  • Index(es):
    • Date
    • Thread