开发者

Converting ex. 2009-12-31T00:00:00.0000000-05:00 format to NSDate

开发者 https://www.devze.com 2023-02-05 18:01 出处:网络
I am working with getting data from webservice in iPhone app and getting a date in format 2009-12-开发者_如何学JAVA31T00:00:00.0000000-05:00.. How can I convert this to NSDate.. Please help....The pro

I am working with getting data from webservice in iPhone app and getting a date in format 2009-12-开发者_如何学JAVA31T00:00:00.0000000-05:00.. How can I convert this to NSDate.. Please help....


The problem with this format is that the -05:00 format is not supported by NSDateFormatter date formats.

Unicode date format patterns says it supports -0500 though. You may have to manually strip the colon out of the timezone and then parse it using the format yyyy-MM-dd'T'HH:mm:ss.0000000ZZZ (or maybe yyyy-MM-dd'T'HH:mm:ss.SSSZZZ)


Please follow this link and try taking your date in string format...the convert it to NSDate

0

精彩评论

暂无评论...
验证码 换一张
取 消