DateManager.swift
606 Bytes
//
// DateManager.swift
// browser
//
// Created by Artem Talko on 17.10.2023.
//
import Foundation
final class DateManager {
static let shared = DateManager()
func getTimeFromDB(_ date: Date?) -> String {
let timeFormatter = DateFormatter()
timeFormatter.dateFormat = "h:mm a"
return timeFormatter.string(from: date ?? Date())
}
var dateFormatter: DateFormatter{
let obj = DateFormatter()
obj.dateFormat = "EEEE, d MMM"
return obj
}
var currentDate: Date {
let obj = Date()
return obj
}
}