iphone - How do I get a timestamp from an NSString date? -


I have an NSString date ( @ "Monday, 01 February 2010 20:25:37 +0000" / Code>) that I want to convert to a timestamp so that I can better calculate how much time has passed since the present time. How can I change the NSString date to a timestamp value?

This has not been tested in full but it should do the trick.

  NSDateFormatter * formatter = [[NSDateFormatter alloc] initWithDateFormat: @ "EEE, DD MMM yyyy HH: mm: SSZZZ" allowNaturalLanguage: no]; NSDT * Date = [Formattor Deaththrustring: @ "Mon, 01 Februar 2010 20:25:37 +0000"];  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -