Date
extension Date
                - 
                  
                  
Constant time stamp format
Declaration
Swift
public static let CheetahDateFormat: String - 
                  
                  
Constant date format
Declaration
Swift
public static let CheetahStringFormat: String - 
                  
                  
Static method that creates a
Dateobject from a string with a given formatDeclaration
Swift
public static func dateFrom(string: String, withFormat format: String) -> Date?Parameters
stringThe formatted date string
formatThe format of the string-represented date
Return Value
The created
Dateobject - 
                  
                  
Static method that creates a
Dateobject from a time stamp stringDeclaration
Swift
public static func dateFrom(timestampString timestamp: String) -> Date?Parameters
timestampThe time stamp string
Return Value
The created
Dateobject - 
                  
                  
Static method that creates a
Dateobject from a formatted string with theDate.CheetahStringFormatformatDeclaration
Swift
public static func dateFrom(formattedString string: String) -> Date?Parameters
stringThe formatted date string
Return Value
The created
Dateobject - 
                  
                  
Instance method that creates a formatted dates string using the default locale (en_US_POSIX) and a specified format
Declaration
Swift
public func string(withFormat format: String, locale: Locale? = nil) -> StringParameters
formatThe desired format
localeThe locale that will be used
 - 
                  
                  
Instance method that creates the time stamp string from
Dateobject using theDate.CheetahDateFormatformatDeclaration
Swift
public var timestampString: String { get } - 
                  
                  
Instance method that creates a formatted date string from the current locale using a specified format
Declaration
Swift
public func localizedString(withFormat format: String) -> StringParameters
formatThe desired format
Return Value
The formatted date string
 - 
                  
                  
Instance method that creates a formatted string of the date using the specified format
Declaration
Swift
public func formattedStringWithDate(showDate: Bool, showTime: Bool, timeZone: TimeZone = .current) -> String?Parameters
showDateShow date with long format
showTimeShow time with short format
timeZoneTime zone that will be used
Return Value
The formatted date string
 - 
                  
                  
Instance method that calculates the number of years between a given date
Declaration
Swift
public func numberOfYears(fromDate date: Date) -> Int?Parameters
dateTThe given date to calculate against
Return Value
The number of years between the given date
 
View on GitHub
        Date Extension Reference