Swift Date Components & Calculations Tutorial
HTML-код
- Опубликовано: 2 окт 2024
- Go to squarespace.co... to save 10% off your first purchase of a website or domain using code SEANALLEN.
In this video I show you how to create a Swift Date object from DateComponents and use those dates to demonstrate a few different calculations. I show you how to add or subtracts dates from each other, how to get the time interval between two dates and how to check if two dates are in the same time period. Swift's Calendar object is what makes this all relatively simple for us developers.
My iOS Dev Courses:
seanallen.teac...
Project Source Code:
seanallen.teac...
X (Twitter):
Sean Allen - / seanallen_dev
Hired.com:
hired.com/x/1n01g
Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):
Paul Hudson's Hacking With Swift:
gumroad.com/a/...
Donny Wals - Combine:
gumroad.com/a/...
Mark Moeyken’s SwiftUI Books:
www.bigmountainstudio.com/swiftui-views-book/fzc51
Objc.io Books (Thinking in SwiftUI & Advanced Swift):
gumroad.com/a/...
Timestamps:
0:00 - Date Components
0:51 - Create a Date from DateComponents
3:08 - Get Specific Component from a Date
5:12 - Add or Subtract Date from other Date
6:38 - Get Start/End of Time Period from Date
8:47 - Get Time Interval Between Dates
9:50 - Are Two Dates in the Same Time Period
#swift #softwaredeveloper #iosdeveloper
Learn more with my iOS Dev Courses & Source Code - seanallen.teachable.com
I've tried to watch this video so many times but have been thinking its too hard so give up. Finally sat down to watch it and you make it make sense. I've watched so many of your videos whilst learning to code. Thank you for making them. I have learnt a lot.
Appreciate the content. Your vids are the best! 👍
Thanks for the kind words :)
Thanks Sean, Great content.
Glad you enjoyed it!
Almost read this as dating... :)
Dealing with dates always do my head in so this is very timely Sean. Thanks heaps mate.
Happy to help!
Excellent tutorial Sean - Thanks
Glad it was helpful!
Thanks!
I appreciate that, Andrew :)
Great tutorial. I keep coming back to it for reference.
Date math is fun, isn't it?
This was the video I needed a year ago when I came up with an idea for an app, but I struggled with it back then. Glad to see this is available now
A lot struggle when working with dates. Wish I coulda helped back then!
@@seanallenyou helped with a lot of other things! No sweat
Hello sir…. I randomly found ur content i loved it…. I am college dropout and i wanted to get a job in tech…. is it possible…? Please help me to choose between python and swift to get a job… thank you…
It's absolutely possible. I'm not saying it will be easy, but it's possible.
@@seanallen i am confused to choose a career path.. should i go with python or should i choose swift to get a job …
thank you Sean.
You're welcome :)
Thank you !
Awesome!
Thanks!
I've spent more time learning about and messing with Date/Calendar than I'd like in building my app, but I've only scratched the surface. Great tutorial, Sean.