Skip to content

Commit

Permalink
- New: Converts a Date to a string with ISO format by default
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrojimenez committed Feb 25, 2017
1 parent e1b8e41 commit 3716195
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/GIGUtils/Date/NSDate+GIGExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ public extension Date {
return Date()
}

public func string(with format: String = DateISOFormat) -> String {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = format
dateFormatter.amSymbol = ""
dateFormatter.pmSymbol = ""
return dateFormatter.string(from: self)
}


/**
Set the time to a NSDate
Expand Down

0 comments on commit 3716195

Please sign in to comment.