开发者

How can i convert NSString to NSDate?

开发者 https://www.devze.com 2023-01-27 09:55 出处:网络
How can i convert NSString to NSDate? from these Strings: NSString *year = @\"2010\"; NSString *month = @\"3开发者_JS百科\";

How can i convert NSString to NSDate?

from these Strings:

    NSString *year = @"2010";
NSString *month = @"3开发者_JS百科";
NSString *day = @"12";

to change UIDatePicker.Thanks


NSDateFormatter can turn a string into a date. You create an NSDateFormatter object, set its format using setDateFormat: and then use its dateFromString: method to convert a string into a date.

0

精彩评论

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

关注公众号