I get the created date and time of a file using attributesOfItemAtPath:. I get the NSString as result which displays Date Created: 2011-08-23 10:47:33 +0000. But, how can I retrieve the information about the date alone from the NSString ignoring the information about time. i.e. my result should be like Date Created: 2011-08-23.
I get the created date and time of a file using attributesOfItemAtPath: . I
Share
Doesn’t the attributesOfItemAtPath: return an NSDate? That’s what the docs says. To get a string with just the date from an NSDate, use an NSDateFormatter. Code might look a bit like this: