import Foundation
extension Date {
func monthName() -> String {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "MMMM" // Use "MMM" for abbreviated month name
return dateFormatter.string(from: self)
}
}
let date = Calendar.current.date(from: DateComponents(year: 2025, month: 2, day: 8))!
let monthName = date.monthName()
print(monthName)
/*
run:
February
*/