//
//  Date-Extension.swift
//  DouYuUI
//
//  Created by davidhuang on 2022/8/11.
//  Copyright © 2022 davidhuang. All rights reserved.
//

import UIKit
extension Date {
    static func getCurrentDate() -> String {
        let now = Int(Date.timeIntervalSinceReferenceDate)
        return "\(now)"
    }
    
    
    init(_ dateString: String, dateFormat: String = "yyyy-MM-dd") {
        let df = DateFormatter()
        df.dateFormat = dateFormat
        let date = df.date(from: dateString)!
        self.init(timeInterval: 0, since: date)
    }
}
