thieumao

Convert Time Swift 3

Dec 15th, 2016
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.25 KB | None | 0 0
  1.     func convert(with time: TimeInterval) -> String {
  2.         let date = Date(timeIntervalSince1970: time)
  3.         let dateFormatter = DateFormatter()
  4.         dateFormatter.dateFormat = "yyyy/MM/dd"
  5.         return dateFormatter.string(from: date)
  6.     }
Advertisement
Add Comment
Please, Sign In to add comment