How to Get Date from a double value...
getDateFrom:(double)value
{
NSTimeInterval seconds = value;
NSInteger numberOfDigits = [self numberOfDigitsIn:value];
if (numberOfDigits > 10)
{
seconds = value / 1000;
}
NSDate *date = [NSDate dateWithTimeIntervalSince1970:seconds];
NSLog(@"Date is %@" date);
}
No comments:
Post a Comment