In Android, I am using `java.util.Calendar` to get yesterday date in format `yyyy-MM-dd'T'hh:mm:ss'Z'`. For example if today is `31 May 2017`, I want to get yesterday date as `2017-05-30T00:00:00Z`.

```
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);

```

I am expecting output to be `2017-05-30T00:00:00Z`. But it gives me `2017-05-30T12:00:00Z`.

What is wrong here? Is it TimeZone related? My timezone is `GMT/UTC + 08:00 hour`.