Avatar
@swift-5.6.3 import Foundation let dateS = "2022-03-08T15:00:00.000Z" let f = ISO8601DateFormatter() var c = Calendar(identifier: .gregorian) c.timeZone = .init(secondsFromGMT: 9 * 3600)! let todayDay = c.component(.day, from: f.date(from: dateS)!) print(todayDay) (edited)