Created
August 5, 2017 05:50
-
-
Save iAmrSalman/fcd05d3b5564641eb20ab6dee7376a6a to your computer and use it in GitHub Desktop.
[formate loclized date from unix date] #swift3 #date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fileprivate func formatDate(fromUnixDate ud: Int) -> String { | |
let date = Date(timeIntervalSince1970: TimeInterval(ud)) | |
let dateString = DateFormatter.localizedString(from: date, dateStyle: .medium, timeStyle: .short) | |
return dateString | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment