Skip to content

Instantly share code, notes, and snippets.

View dlsolution's full-sized avatar
🏠

Linh Vo dlsolution

🏠
View GitHub Profile
@dlsolution
dlsolution / ios-interview-resources.md
Created January 18, 2021 07:05
ios-interview-resources.md
@dlsolution
dlsolution / dates-in-swift.md
Created January 18, 2021 07:03
dates-in-swift.md

Objects for working with Date in Swift's Foundation framework:

  • Date: This is a struct that represents a specific point in time independent of any calendar or time zone. It has methods for creating dates, comparing dates and calculating time intervals between dates. It is not responsible for the date format or conversions between string and date.

  • DateFormatter: It provides methods for converting Date to String and String to Date. You can customise the date string using predefined styles in DateFormatter.Style or create your own custom format.

  • DateComponents: This is a Date or Time object represented in units such as the year, month, day, minute or hour in a particular calendar. It provides direct access to different parts of a date or time.

Resources