Skip to content

Instantly share code, notes, and snippets.

@leeyspaul
Created December 11, 2021 01:06
Show Gist options
  • Select an option

  • Save leeyspaul/5a60da9292c1249bcae996879efe14cb to your computer and use it in GitHub Desktop.

Select an option

Save leeyspaul/5a60da9292c1249bcae996879efe14cb to your computer and use it in GitHub Desktop.

Revisions

  1. leeyspaul created this gist Dec 11, 2021.
    7 changes: 7 additions & 0 deletions dfexample.swift
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    import Foundation

    let date = Date()
    let df = DateFormatter()

    df.dateFormat = "MMM d, yyyy" // prints out "Dec 10, 2021"
    print(df.string(from: date))