iOS Converting Internet Date Without DST Messing It Up

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
Here is the issue. I have an app I have built in which localendar.com is used for the calendar of events. Localendar has no option to set timezones to DST, so events that are currently going on appear as:

Wed, 05 Jun 2013 22:00:00 CST

instead of:

Wed, 05 Jun 2013 22:00:00 CDT

The issue is that when I convert this string to an NSDate for sorting purposes, it moves the time forward one hour because it is now DST. So, instead of the result being 6/5/13 10:00 PM, it shows as 6/5/13 11:00 PM.

What I am needing is a good way to parse this date so that it will show up as 10:00 PM now, and not mess anything up when DST ends later this year. Any suggestions?
 

dejo

Moderator
Staff member
Sep 2, 2004
15,981
447
The Centennial State
Is asking a question on two different sites not allowed?
To quote fellow member PhoneyDeveloper (from another thread), with a slight edit:
Don't cross-post.

It is rude to expect other people to freely give their time to answer your question that might already be answered on another forum.

Ask your question on one forum. Wait a suitable period of time for a reply, say 24 to 48 hrs. If you get no reply then it's fair post somewhere else.
 

chown33

Moderator
Staff member
Aug 9, 2009
8,486
4,495
Restivus
I know how to check if a specific NSDate is listed as DST,
Exactly how would you do that? Post your code.

is it much different to find out if the system wide time is currently DST?
I don't think you actually read the NSTimeZone class reference, or even looked at it. If you had, or if you had simply visited the online web page and then searched for "daylight" on the page, the answer would have been as clear as, well, daylight.

Another keyword to search for in the NSTimeZone class reference is "system", as in "system time zone". Also find "local", as in "local time zone".

If, after reading the NSTimeZone class reference, you have a specific question that isn't answered in the class reference, then please ask it. If you haven't read the NSTimeZone class reference, then do that first.