title: Generate string of yesterday’s date-time in ISO 8601 format
body: <p>In Android, I am using <code>java.util.Calendar</code> to get yesterday date in format <code>yyyy-MM-dd'T'hh:mm:ss'Z'</code>. For example if today is <code>31 May 2017</code>, I want to get yesterday date as <code>2017-05-30T00:00:00Z</code>.</p>
  
  <pre><code>Calendar calendar = Calendar.getInstance();
  calendar.set(Calendar.HOUR_OF_DAY, 0);
  calendar.set(Calendar.MINUTE, 0);
  calendar.set(Calendar.SECOND, 0);
  calendar.set(Calendar.MILLISECOND, 0);
  
  // Date End = yesterday
  calendar.add(Calendar.DATE, -1);
  Date dateEnd = calendar.getTime();
  
  SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss'Z'");
  this.dateEndStr = formatter.format(dateEnd);
  </code></pre>
  
  <p>I am expecting output to be <code>2017-05-30T00:00:00Z</code>. But it gives me <code>2017-05-30T12:00:00Z</code>.</p>
  
  <p>What is wrong here? Is it TimeZone related? My timezone is <code>GMT/UTC + 08:00 hour</code>.</p>