I am not able to get current india time.
I want to get current time for india, i updated my system clock after 5 minute then current time, so my system clock is running 5 minute earlier than actual india time but i want to get standard time for india.
current time is 11:05:06 and machine time is 11:10:06
public class TestDate {
public static void main(String[] args) {
SimpleDateFormat sd = new SimpleDateFormat("yyyy.MM.dd G 'at' HH:mm:ss z");
Date date = new Date();
sd.setTimeZone(TimeZone.getTimeZone("IST"));
System.out.println(sd.format(date));
}
}
output : 2019.02.12 AD at 11:10:06 IST
expected : 2019.02.12 AD at 11:05:06 IST
but i am getting wrong output , so please suggest