         return String(Date.rat.timestampforNow)
     }
 
-    // MARK: Component
+}
+
+
+// MARK: - Component
+
+extension DateExtension {
+
     /// 某时间点对应的 year 值
     public var year: Int {
         return components(unit: .year)

    public static var rat: DateExtension.Type {
        return DateExtension.self
    }
}

public struct DateExtension {
    private var date: Date

    fileprivate init(date: Date) {
        self.date = date
    }

    //  MARK: Transform
    /// 某个时间对应的时间戳
    public var timestamp: TimeInterval {
        return date.timeIntervalSince1970


import Foundation


extension Date {

    public var rat: DateExtension {
        return DateExtension(date: self)
    }
