开发者

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

开发者 https://www.devze.com 2023-03-28 05:35 出处:网络
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

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

精彩评论

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