Duration 7:53

Swift Tutorial: DateFormatter (dateStyle, Locale, am/pm, dateFormat, weekdaySymbols)

1 530 watched
0
40
Published 22 Apr 2021

In this Swift tutorial we’ll look at how to use DateFormatter to format dates in both a pre-defined way using Swift’s ‘style’ enums, as well as custom formats using dateFormat. We’ll format date, time, weekday symbols, and more. Days: E, EE, EEE - Wed EEEE - Wednesday / or weekday symbol EEEEE - W Months: M - 4 MM - 04 MMM - Apr MMMM - April MMMMM - A Years: Y - 2021 YY - 21 YYY - 2021 YYYY - 2021 year: y, yy, yyy, yyyy - 2021 Time Zone: Z, ZZ, ZZZ - -04:00 ZZZZ - GMT-04:00 Hit the like button, comment, subscribe, and hit the dinner bell to be notified of my next video! If you'd like to support my work to help me improve video quality and bring more content, please consider donating to my PayPal: https://www.paypal.com/paypalme/SwiftGoose 00:00 Intro 00:17 Create DateFormatter() 00:28 AM and PM symbols 00:58 dateStyle 01:17 timeStyle 01:43 Locale 02:41 dateFormat 03:44 Days of the week (E) 03:56 weekdaySymbols 05:09 Months (M) 05:25 Years (Y) 05:59 Seconds (s and S) 06:13 Time zone (Z) 07:10 setLocalizedDateFormatFromTemplate 07:30 End Subscribe for more content, as I will be creating more tutorial and how-to videos for coding in Swift, as well as longer tutorials on building macOS apps. Thank you for watching! Huge thank you to the channels below for helping me get started! Uncreated Light Press /channel/UCcNI7mR_Nzulq0THjdrzlag and Mr. Macintosh /channel/UC7FRPWLwRlhORhFHHywfqAg and The Apple Ninja /c/JesseTheAppleNinja

Category

Show more

Comments - 13