Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

date formatter swift

func getTimeStampDateString() -> String {
        let date = Date(timeIntervalSinceNow: self.doubleValue)
        let dateFormatter = DateFormatter()
        dateFormatter.timeZone = TimeZone(abbreviation: "GMT")
        dateFormatter.locale = NSLocale.current
        dateFormatter.dateFormat = "d MMM HH:mm:ss"
        let strDate = dateFormatter.string(from: date)
        return strDate
    }
 
PREVIOUS NEXT
Tagged: #date #formatter #swift
ADD COMMENT
Topic
Name
8+5 =