 
 // MARK: SPIUtils
 
-/// A set of utility functions.
 public class SPIUtils {
     
+    ///
     /// Abbreviations for month names
+    ///
     private static let months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
-        "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
+                                 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
     
+    ///
     /// Abbreviations for days of the week
+    ///
     private static let days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
     
-    /// Format the current time for use in HTTP.
     ///
-    /// - Returns: string representation of timestamp.
-    public static func httpDate() -> String {
-        var theTime = time(nil)
+    /// Format the given time for use in HTTP, default value is current time.
+    ///
+    /// - Parameter timestamp: the time ( default value is current timestamp )
+    ///
+    /// - Returns: string representation of timestamp
+    ///
+    public static func httpDate(from timestamp: time_t = time(nil)) -> String {
+        
+        var theTime = timestamp
         var timeStruct: tm = tm()
         gmtime_r(&theTime, &timeStruct)
         

                                   "80", "81", "82", "83", "84", "85", "86", "87", "88", "89",
                                   "90", "91", "92", "93", "94", "95", "96", "97", "98", "99"]
}

        
    }
    
    ///
    /// Format the given date for use in HTTP
    ///
    /// - Parameter date: the date
    ///
    /// - Returns: string representation of Date
    ///
    public static func httpDate(_ date: Date) -> String {
        return httpDate(from: time_t(date.timeIntervalSince1970))
    }

    ///
