Complex questions like "what's the current day of the year" end up having simple, almost poetic answers like "calendar.ordinality(of: .day, in: .year, for: date)".
Never give the government a power you wouldn't want your worst enemy to have. Because eventually they will find their way into power.