It seems that NSDateFormatter has a "feature" that bites you unexpectedly: If you do a simple "fixed" format operation such as: NSDateFormatter* fmt = [[NSDateFormatter alloc] init]; [fmt setDateFor...
I have a NSString (ex. "2011-04-12 19:23:39"), and what I did to format it to a NSDate was the following: [inputFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; NSDate *date = [inputFormatter dateFr...
I got a string that contains the current date by using this : NSString *date = [[NSDate date] description]; At a different point I want to retrieve the date from this string and I used the followin...
im using xcode 4.5(4G182) with iOS 6. NSDateFormatter show wrong year in iOS 6, how to solve? NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; [dateFormatter setDateForm...
If I use the following code: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm"]; NSDate *myDate = [dateFormatter dateFromString:@"...
I basically need to get current date and time separately, formatted as: 2009-04-26 11:06:54 The code below, from another question on the same topic, generates now: |2009-06-01 23:18:23 +...
I am trying to parse a date string from xml into an NSDate object in an iPhone app I am aware this must have been asked before, however, I believe I have the right syntax, but it is not working. Is t...
What is exact difference between 'YYYY' and 'yyyy'. I read in this link, it states that A common mistake is to use YYYY. yyyy specifies the calendar year whereas YYYY specifies the year (of “...
I'm trying to store a time in a date. In this case 1.5 seconds. I store the time in the date like this: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@...
I have data that contains a date string. Normally it would be in a 'Jan. 3, 1966' type format, but because of international differences, it may not always be exactly that. I need to read the dat...