SPIUtils

public class SPIUtils

A set of utility functions. Includes formatting the given time and date for use in HTTP, where the default value is the current time.

Usage Example:

//Format the given date for use in HTTP
SPIUtils.httpDate()
  • Format the given time for use in HTTP, default value is current time.

    Usage Example:

     SPIUtils.httpDate(from: date)
    

    Declaration

    Swift

    public static func httpDate(from timestamp: time_t = time(nil)) -> String

    Parameters

    timestamp

    the time ( default value is current timestamp )

    Return Value

    string representation of timestamp

  • Format the given date for use in HTTP

    Usage Example:

    SPIUtils.httpDate()
    

    Declaration

    Swift

    public static func httpDate(_ date: Date) -> String

    Parameters

    date

    the date

    Return Value

    string representation of Date