Esqarrouth/EZSwiftExtensions

Date.iso8601

lfarah opened this issue · 4 comments

What do you guys think?
Got it from this link

ISO8601 is a representation of dates and times is an international standard covering the exchange of date and time-related data. Many backend services like to use ISO8601, which looks like this:
1990-01-01T00:00:00

extension Date {
    
    var iso8601: String {
        let formatter = ISO8601DateFormatter()
        return formatter.string(from: self)
    }
}

Is this internationalized ? I mean a comment for context pls.

@Khalian better?

I guess this a good idea. The only tricky part would be testing, since we do not know which time zone the travis ci build servers are. I assume we can test some custom dates and their iso8601 counterparts. Otherwise it looks good, I think you can go ahead and submit a PR.

PR in #375