views:

65

answers:

1

I have an NSString like this @"2010-08-30T11:00:00-04:00" . How to convert this to an NSDate ? Which DateFormat should be used with it ? I tried this @"yyyy-MM-dd'T'HH:mm:ss-SSS" . But didn't worked. Please help me.

  • Edit

I found @"yyyy-MM-dd'T'HH:mm:ss-SSS" was working fine in OS version 3.1 . But its not getting in 4.0 .This question also pointing similar problem. Please give a solution

A: 

Knowing the timezone to be GMT - 4 hours is not enough to determine if daylight saving should be applied or not. Daylight saving is determined based on the geopolitical borders. For instance is daylight saving not applied in the same months above and below equator. Additional countries close to equator do seldom use daylight saving at all.

So, you need to get the named timezone in order to be able to apply daylight saving correctly.

Claus Broch