Java Timezone giving one hour delay for IST on AWS Server but correct on my local server
<p>I need to run a scheduler based on time.
The application is for IST(Indian Standard Time) and my code to get time is</p>

<pre><code>    SimpleDateFormat formatter = new SimpleDateFormat("HH");
    final TimeZone utc = TimeZone.getTimeZone("IST");
    formatter.setTimeZone(utc);
    Calendar c = Calendar.getInstance();
    c.add(Calendar.DATE, 0);
    String timeStr = (String) (formatter.format(c.getTime()));
    int time = Integer.parseInt(timeStr);
    System.out.println("Time is -&gt;"+ time);
</code></pre>

<p>Now when I run this on my localhost server which is in India, it returns the correct hour. But when the same code is deployed on AWS, the time it returns in one hour delay of actual time. So when it is 9 am, on AWS it always return 8.
I am not able to understand why this is happening. Also, Daylight saving does not happen in India. So that should not be a possible reason.
Please help.</p>