Files
OnlineChatSdk-SwiftPM/OnlineChatSdk/Classes/ChatDateFormatter.swift

21 lines
566 B
Swift
Raw Normal View History

2020-08-17 18:48:47 +07:00
import Foundation
2024-11-21 17:36:28 +07:00
class ChatDateFormatter : DateFormatter, @unchecked Sendable {
2020-08-18 17:37:46 +07:00
2020-08-17 18:48:47 +07:00
override init() {
super.init()
self.calendar = Calendar(identifier: Calendar.Identifier.iso8601)
self.dateFormat = "yyyy'-'MM'-'dd' 'HH':'mm':'ss'"
self.locale = Locale(identifier: "en")
self.timeZone = TimeZone(secondsFromGMT: 10800)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
2020-08-18 17:37:46 +07:00
public func getCurrent() -> String {
self.string(from: NSDate() as Date)
}
2020-08-17 18:48:47 +07:00
}