1

I have a string which contains a duration ISO-8601 format. I need to convert this to NSDate.

I have looked at a couple of categories but could not find a suitable option.

Any help is appreciated.

http://www.w3.org/TR/xmlschema-2/#duration

Ankit Srivastava
  • 12,347
  • 11
  • 63
  • 115
  • What to you mean converting a duration with a date? Don't you want to try converting a duration into a future ending date according to a starting date? – Larme Feb 21 '14 at 11:23
  • NSDate isn't used to represent duration. NSTimeInterval is used for that. And, to my knowledge, there is no standard tool to do conversion between ISO-8601 durations and NSTimeInterval, so you will have to roll your own. It couldn't be that hard, other than deciding how long a month is. – Hot Licks Feb 21 '14 at 12:23
  • Check this http://stackoverflow.com/questions/2201216/is-there-a-simple-way-of-converting-an-iso8601-timestamp-to-a-formatted-nsdate, maybe help you. – Dimitris Bouzikas Feb 21 '14 at 13:16

0 Answers0