title: Swift Date Timezone Issue
body: <pre><code>extension Formatter {
      static let iso8601: DateFormatter = {
          let formatter = DateFormatter()
          formatter.calendar = Calendar(identifier: .iso8601)
          formatter.timeZone = TimeZone.init(identifier: "America/New_York")
          formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
          return formatter
      }()
  }
  extension Date {
      var iso8601: String {
          return Formatter.iso8601.string(from: self)
      }
  }
  
  extension String {
      var dateFromISO8601: Date? {
          return Formatter.iso8601.date(from: self)   // "Mar 22, 2017, 10:22 AM"
      }
  }
  
  
  
  let dateFormat:String = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
  let strDate: String = "2017-10-09T00:00:00.966Z"
  if let dateFromString = strDate.dateFromISO8601
  {
      print(dateFromString.iso8601)
  }
  </code></pre>
  
  <p>Ok, so it does not do anything with the dateFormatter.date(from: sweDate)!) then? <strong>How can I get the string value to Date?</strong></p>
  
  <p>As per my knowledge  Date doesn't store the time zone so it always prints the UTC time no matter what the time zone i have used upon formatting. </p>
  
  <p>So what is the solution as i have to compare my local date with the converted date. which i cannot compare with the string.
  Any help is appreciated.</p>