Re: How to get the time zone of a parsed date/time string?
Re: How to get the time zone of a parsed date/time string?
- Subject: Re: How to get the time zone of a parsed date/time string?
- From: Jens Alfke <email@hidden>
- Date: Wed, 30 Jul 2014 12:08:39 -0700
> On Jul 30, 2014, at 11:59 AM, Alex Zavatone <email@hidden> wrote:
>
> Hmmm. OK. I reread your original post.
>
> Isn't there timeZoneWithAbbreviation: within NSTimeZone that allows this?
*facepalm*
I did not ask how to convert a time zone string to an NSTimeZone object.
I asked how to parse the time zone out of an ENTIRE FORMATTED DATE/TIME STRING that's in some arbitrary format.
The result from NSDateFormatter is an NSDate object, which does not contain any time zone info.
Alex, I think you’re jumping to the conclusion that of course I would hack into the string and scrape out the part of it containing the time zone. Actually no, I am avoiding that if humanly possible. I’ve been down that road before and it ends with writing your own date parser, which is a nightmare. Date parsing is ugly and complicated and I want to leave it to ICU.
—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