diff --git a/Sources/Mixpanel.m b/Sources/Mixpanel.m index a3d7a460..18233db9 100755 --- a/Sources/Mixpanel.m +++ b/Sources/Mixpanel.m @@ -523,12 +523,12 @@ - (void)track:(NSString *)event properties:(NSDictionary *)properties [Mixpanel assertPropertyTypes:properties]; NSTimeInterval epochInterval = [[NSDate date] timeIntervalSince1970]; - NSNumber *epochSeconds = @(round(epochInterval)); + NSNumber *epochMilliseconds = @(round(epochInterval * 1000)); dispatch_async(self.serialQueue, ^{ NSNumber *eventStartTime = self.timedEvents[event]; NSMutableDictionary *p = [NSMutableDictionary dictionaryWithDictionary:self.automaticProperties]; p[@"token"] = self.apiToken; - p[@"time"] = epochSeconds; + p[@"time"] = epochMilliseconds; if (eventStartTime != nil) { [self.timedEvents removeObjectForKey:event]; p[@"$duration"] = @([[NSString stringWithFormat:@"%.3f", epochInterval - [eventStartTime doubleValue]] floatValue]);