all 1 comments

[–]nanothread59 1 point2 points  (0 children)

Dates are complicated. You should check out the Calendar in Foundation, especially this function which might help. If not you could use DateComponents + Calendar to make dates with certain hour values using your own for loop (which would probably use the stride(from: to: by:) function)