Wrong value recived when decoding date in swift
let dateFormatterGet = DateFormatter()
dateFormatterGet.dateFormat = "LLL YYYY"
dateFormatterGet.timeZone = TimeZone(abbreviation: "UTC")
dateFormatterGet.locale = Locale(identifier: "en_US_POSIX")
if let date = dateFormatterGet.date(from: "Mar 2020") {
print(dateFormatterGet.string(from: date))// Prints Dec 2019
print(date)//2019-12-22 00:00:00 +0000
} else {
print("There was an error decoding the string")
}
it prints 2019-12-22 00:00:00 +0000