I have been researching, but I couldnt find exact solution for my problem. I have been trying to get 1 hour ago from a date. How can I achieve this in swift?
If you are using NSDate you can do:
NSDate
let date = NSDate() date.dateByAddingTimeInterval(-3600)
It will change the date object to be "1 hour ago".
date