[+] Add toString to Date
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user