Skip to content

Instantly share code, notes, and snippets.

@wassim93
Created August 23, 2021 02:30
Show Gist options
  • Save wassim93/2d8c49a1b79c926c400b037dd94223b2 to your computer and use it in GitHub Desktop.
Save wassim93/2d8c49a1b79c926c400b037dd94223b2 to your computer and use it in GitHub Desktop.
Date Format in Swift
Wednesday, Sep 12, 2018 --> EEEE, MMM d, yyyy
09/12/2018 --> MM/dd/yyyy
09-12-2018 14:11 --> MM-dd-yyyy HH:mm
Sep 12, 2:11 PM --> MMM d, h:mm a
September 2018 --> MMMM yyyy
Sep 12, 2018 --> MMM d, yyyy
Wed, 12 Sep 2018 14:11:54 +0000 --> E, d MMM yyyy HH:mm:ss Z
2018-09-12T14:11:54+0000 --> yyyy-MM-dd'T'HH:mm:ssZ
12.09.18 --> dd.MM.yy
10:41:02.112 --> HH:mm:ss.SSS
if you want 12.09.18 you use dateformater.dateformat = "dd.MM.yy"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment