13 lines
224 B
Swift
13 lines
224 B
Swift
import Foundation
|
|
|
|
extension Date {
|
|
|
|
var timestamp: UInt32 {
|
|
UInt32(timeIntervalSince1970.rounded())
|
|
}
|
|
|
|
init(timestamp: UInt32) {
|
|
self.init(timeIntervalSince1970: TimeInterval(timestamp))
|
|
}
|
|
}
|