I want to convert these two variables into Swift language but I cant seem to figure out the best way to do this bc of the fact that dateWithTimeIntervalSinceNow
works differently in swift.
NSNumber *startDate = @((unsigned long long)([[NSDate dateWithTimeIntervalSinceNow:-(60*60)] timeIntervalSince1970]*10000000));
NSNumber *endDate = @((unsigned long long)([[NSDate date] timeIntervalSince1970]*10000000));
My attempt so far:
let calendar = NSCalendar.currentCalendar()
let oneDayAgo = calendar.dateByAddingUnit(.CalendarUnitDay, value: -1, toDate: NSDate(), options: nil)
var startNum:NSNumber = oneDayAgo!.timeIntervalSince1970*10000000`
Is this roughly what you're trying to do?