Ive been racking my brains with no luck. Could someone please tell my how i would convert this string:
NSString *dateTimeStr =[[self.responseArray objectAtIndex:indexPath.row]objectForKey:@"date_time"];
2014-04-13T17:00:00+11:0
into a NSDate
? and time format ?
how can i covert this date into time format ?
here is my code:
NSString *dateTimeStr =[[self.responseArray objectAtIndex:indexPath.row]objectForKey:@"date_time"];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setTimeZone:[NSTimeZone localTimeZone]];
[dateFormatter setDateFormat:@"yyyy-MM-ddHH:mm:ss"];
NSDate *date = [dateFormatter dateFromString:dateTimeStr];
NSLog(@"date %@", date);
NSTimeInterval seconds = [date timeIntervalSinceReferenceDate];
in console
NSLog(@"seconds==> %f", seconds);
i have time in miliseconds then how can i take out minutes/hours/
?