开发者

Can someone help me convert a dotNet statement to a objective-C statement?

开发者 https://www.devze.com 2023-03-14 16:06 出处:网络
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\");

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号