Can someone help me convert a dotNet statement to a objective-C statement?
I am not a dotNet developer and was trying to read up some documentation on the following method:
signDate = Convert.ToDateTime("6/22/2011 8:35:21 PM");
开发者_开发百科
What would be an equivalent function/method in objective C?
I am also not a .NET developer, but it looks like you're looking for dateWithNaturalLanguageString
:
NSDate *signDate = [NSDate dateWithNaturalLanguageString:@"6/22/2011 8:35:21 PM"];
I believe you should check out the NSDateFormatter Documentation. In particular, I believe you want the method dateFromString:
In addition, or for a quick overview, check out the Date Formatters Guide.
精彩评论