title: Create a list of Time Interval Swift 3
body: <p>I would like to create a tuple list of times like so; every hour going from 0 to 23.</p>
  
  <pre><code>tuple = [(2017-03-24 00:00:00 +0000, 0.0), (2017-03-24 00:01:00 +0000, 0.0), (2017-03-24 00:02:00 +0000, 0.0), (2017-03-24 00:03:00 +0000, 0.0)]
  </code></pre>
  
  <p>I have tried to use this code which will give me the hours and minutes, however I cannot seem to figure out how to either add the current month, day and year. Or adjust the date format in the Struct.</p>
  
  <p>Thank you for your help. Here is the Struct that I'm using...</p>
  
  <pre><code>import Foundation
  
  struct TimeDay {
  
  let start: TimeInterval
  let end: TimeInterval
  let interval: TimeInterval
  
  init(start: TimeInterval, interval: TimeInterval, end: TimeInterval) {
      self.start = start
      self.interval = interval
      self.end = end
  }
  
  init(startHour: TimeInterval, intervalMinutes: TimeInterval, endHour: TimeInterval) {
      self.start = startHour * 60 * 60
      self.end = endHour * 60 * 60
      self.interval = intervalMinutes * 60
  }
  
  var timeRepresentations: [String] {
      let dateComponentFormatter = DateComponentsFormatter()
      dateComponentFormatter.unitsStyle = .positional
      dateComponentFormatter.allowedUnits = [.minute, .hour]
  
      let dateComponent = NSDateComponents()
      return timeIntervals.map { timeInterval in
          dateComponent.second = Int(timeInterval)
          return dateComponentFormatter.string(from: dateComponent as DateComponents)!
      }
  }
  
  var timeIntervals: [TimeInterval]{
      return Array(stride(from: start, through: end, by: interval))
  }
  }
  </code></pre>