title: Parsing UTC date retrieved from web service results in local date
body: <p>My goal is to simply retrieve the current UTC time from a web service and produce a Date for consumption. The trouble I am having is that anytime I use my SimpleDateFormatter to parse the date string I end up with the date in local time. I have spent a while researching solutions for this and nothing is working for me. This is my code and check out the attached image for debug values. Thanks anyone for your help.</p>
  
  <pre><code>        URL url = new URL("http://www.timeapi.org/utc/now");
  
          HttpURLConnection conn = (HttpURLConnection) url.openConnection();
          conn.connect();
          BufferedReader in = new BufferedReader( new InputStreamReader(conn.getInputStream()));
          String inputLine;
          StringBuffer response = new StringBuffer();
          while ((inputLine = in.readLine()) != null) {
              response.append(inputLine);
          }
          in.close();
  
          String timeStamp = response.toString(); // response is in this format 2015-09-19T01:09:35+01:00
  
          DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
          formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
          Date date = formatter.parse(timeStamp);
  
          return date;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/qmDhz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qmDhz.png" alt="enter image description here"></a></p>