Reputation: 25
Pretty simple question, but I'm wondering how to make an NSDate from current date and time from NSString NSString content format is like this:"hh:mm:ss" Simple, but I can't do it :)
Upvotes: 0
Views: 163
Reputation: 181280
You can use NSDateFormatter
class to do that.
NSDateFormatter *df = [[[NSDateFormatter alloc] init] autorelease];
[df setDateFormat:@"hh:mm:ss"];
NSDate* date = [df dateFromString:@"20:31:39"];
Upvotes: 1