I am getting date in this format "Thu Jul 20 06:44:40 +0000 2017" and I want to convert it in milliseconds so that I can compare this milliseconds to current date milliseconds.
I want to get 20 min difference from this date "Thu Jul 20 06:44:40 +0000 2017" to current date.
I want to check If 20 or less than 20 min difference is there then only I will do other operation.
I don't know how can I check 20 min difference.
//MiliSeconds from Date
func miliSecFromDate(date : String) -> String {
let strTime = date
let formatter = DateFormatter()
formatter.dateFormat = "E MMM d HH:mm:ss Z yyyy"
let ObjDate = formatter.date(from: strTime)
return (String(describing: ObjDate!.millisecondsSince1970))
}