Here is the solution, the idea is simple get two date one with your time and one with 00:00:00,000 time then take difference of their time.
- (double)secondsFromString:(NSString*)str {
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss,SSS"];
NSString *dateString = @"1970-01-01";
NSDate *date = [formatter dateFromString:[NSString stringWithFormat:@"%@ %@",dateString,str]];
NSDate *refDate = [formatter dateFromString:[NSString stringWithFormat:@"%@ 00:00:00,000",dateString]];
double time = [date timeIntervalSince1970] - [refDate timeIntervalSince1970];
return time;
}