Convert date in millisecond iOS Swift

Use following method for convert current date time in millisecond

func currentDateTimeInMiliseconds() -> Int {
      let currentDate = Date()
      let since1970 = currentDate.timeIntervalSince1970
      return Int(since1970 * 1000)
}

Use following method for convert specific date in millisecond

func convertDateInMiliseconds(date: Date) -> Int {
    let since1970 = date.timeIntervalSince1970
    return Int(since1970 * 1000)
}