Meshtastic-Apple/Meshtastic/Extensions/Date.swift

21 lines
376 B
Swift
Raw Normal View History

2023-04-25 17:56:57 -07:00
//
// Date.swift
// Meshtastic
//
// Copyright(c) Garth Vander Houwen 4/25/23.
//
import Foundation
extension Date {
static var currentTimeStamp: Int64 {
return Int64(Date().timeIntervalSince1970 * 1000)
}
func formattedDate(format: String) -> String {
let dateformat = DateFormatter()
dateformat.dateFormat = format
return dateformat.string(from: self)
}
}