I want to have date formatter print only the short weekday label, like "Mon, Tue, Wed".
What is the correct date format to convert day into 3 letter weekday string?
let formatter = DateFormatter()
formatter.dateFormat = "DDD" //prints 278 and like
It's like I have to learn this stuff every few months all over again:
let formatter = DateFormatter()
formatter.dateFormat = "EEE"
E..EEE Tue Abbreviated Day of week name, format style.
EEEE Tuesday Wide
EEEEE T Narrow
EEEEEE Tu Short
Use this http://nsdateformatter.com
Monday, Oct 8, 2018 = EEEE, MMM d, yyyy
10/08/2018 = MM/dd/yyyy
10-08-2018 04:29 = MM-dd-yyyy HH:mm
Oct 8, 4:29 AM = MMM d, h:mm a
October 2018 = MMMM yyyy
Oct 8, 2018 = MMM d, yyyy
Mon, 8 Oct 2018 04:29:53 +0000 = E, d MMM yyyy HH:mm:ss Z
2018-10-08T04:29:53+0000 = yyyy-MM-dd'T'HH:mm:ssZ
08.10.18 = dd.MM.yy
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With