Here is code to make a simple Swift WWDC countdown:
Code Block swift import Cocoa let today = Date() let startDate = "2020-06-22" let dateFormatter = DateFormatter()dateFormatter.dateFormat = "yyyy-MM-dd" let finalStartDate = dateFormatter.date(from: startDate)let components = Set<Calendar.Component>([.day, .hour]) print("WWDC20 Will Come on JUNE 22") let daysToDc = Calendar.current.dateComponents(components, from: finalStartDate!, to: today) let printableDays = Int(daysToDc.day!) let printableHours = Int(daysToDc.hour!) print(String(printableDays)+" days " + String(printableHours) + " hours till WWDC2020")