In Step 1, we create our howLongUntilChristmas function, then in Step 2, we get the currently set calendar and time zone as they will be needed for the date calculations to come:
let calendar = Calendar.current
let timeZone = TimeZone.current
While retrieving the current time zone is self-explanatory, it is not immediately obvious what the Calendar type represents and why we need to retrieve it.
How dates are represented is not as universally agreed as you might believe. Certain time components are mostly universal, such as the length of years and days, as they are connected to astronomical events, such as the time it takes for the Earth to perform one revolution of the Sun, and for the Earth to complete one rotation around its own axis, respectively. However, other time components, such as months and weeks and how the years are numbered, are rooted in the culture that created them.