Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
dateFormat example
import Foundation
let date = Date()
let df = DateFormatter()
df.dateFormat = "MMM d, yyyy" // prints out "Dec 10, 2021"
print(df.string(from: date))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment