开发者

Is there any method which is equivalent to Convert.ToOADate() of VB in Objective C?

The method Convert.ToO开发者_运维技巧ADate() converts Double data to Date. Is there any method which is equivalent to this method? or kindly help me a method through which we can convert a double data into a datetime


Just use NSDateFormatter

    double myDate;
    NSString *dateString = [NSString stringWithFormat:@"%f",myDate];
    NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
    [dateFormat setDateFormat:@"yyyyMMdd"];
    NSDate *date = [dateFormat dateFromString:dateString];

    [dateFormat release];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜