//
//  Date+Now.swift
//  1Weather
//
//  Created by Dmitry Stepanets on 22.03.2021.
//

import UIKit

extension Date {
    private static var formatter:DateFormatter = {
       let fmt = DateFormatter()
        fmt.dateFormat = "yyyy-MM-dd HH:mm:ss"
        return fmt
    }()
    static func nowDate(timeZone:TimeZone) -> Self? {
        formatter.timeZone = timeZone
        let nowDateString = formatter.string(from: Date())
        return formatter.date(from: nowDateString)
    }
}
