Getting Issue:
Double value cannot be converted to Int because the result would be greater than Int.max
While converting date to time Interval
extension Date {
var millisecondsSince1970:Int {
return Int((self.timeIntervalSince1970 * 1000.0).rounded())
}
init(milliseconds:Int) {
self = Date(timeIntervalSince1970: TimeInterval(milliseconds /
1000))
}