25 lines
676 B
Swift
25 lines
676 B
Swift
//
|
|
// Date.swift
|
|
// wallet
|
|
//
|
|
// Created by Adriana Epure on 24.08.2022.
|
|
// Copyright © 2022 Jason. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
extension Date{
|
|
func adding(minutes: Int) -> Date {
|
|
return Calendar.current.date(byAdding: .minute, value: minutes, to: self)!
|
|
}
|
|
func adding(seconds: Int) -> Date {
|
|
return Calendar.current.date(byAdding: .second, value: seconds, to: self)!
|
|
}
|
|
func format(style: DateFormatter.Style)->String{
|
|
|
|
let utcDateFormatter = DateFormatter()
|
|
utcDateFormatter.dateStyle = style
|
|
utcDateFormatter.timeStyle = style
|
|
return utcDateFormatter.string(from: self)
|
|
}
|
|
}
|