mirror of
https://github.com/hub-team/OnlineChatSdk-SwiftPM.git
synced 2026-04-14 08:49:01 +00:00
21 lines
566 B
Swift
21 lines
566 B
Swift
import Foundation
|
|
|
|
class ChatDateFormatter : DateFormatter, @unchecked Sendable {
|
|
|
|
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")
|
|
}
|
|
|
|
public func getCurrent() -> String {
|
|
self.string(from: NSDate() as Date)
|
|
}
|
|
}
|