[+] Add toString to Date

This commit is contained in:
Hykilpikonna
2021-01-17 13:25:04 -05:00
parent c30f78efbb
commit 6b89b930fc
2 changed files with 23 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
//
// Utils.swift
// ProjectClock
//
// Created by Hykilpikonna on 1/17/21.
//
import Foundation
extension Date
{
/// Add toString to Date
func str() -> String
{
let f = DateFormatter()
f.dateFormat = "yyyy-MM-dd hh:mm:ss"
return f.string(from: self)
}
}