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];
精彩评论