//
//  Date.swift
//  USB Meter
//
//  Created by Bogdan Timofte on 13/04/2020.
//  Copyright © 2020 Bogdan Timofte. All rights reserved.
//

import Foundation

extension Date {

    //  https://nsdateformatter.com
    func format( as format: String = "yyyy-MM-dd HH:mm") -> String {
        let formatter = DateFormatter()
        formatter.dateStyle = .short
        formatter.dateFormat = format
        return formatter.string(from: self)
    }

}
