I am simply creating a java.util.GregorianCalender
GregorianCalendar calender = new GregorianCalendar();
now setting the hour,min,sec and ms as follows
c.set(Calendar.HOUR, 6);
c.set(Calendar.MINUTE, 45);
c.set(Calendar.SECOND, 30);
c.set(Calendar.MILLISECOND, 345);
now printing the output using getTime() method
System.out.println("Date and Time: "+c.getTime());
When System time is in AM, the output is
Date and Time: Tue Feb 09 06:45:23 IST 2016
And When System time is in PM, the output is
Date and Time: Tue Feb 09 18:45:23 IST 2016
Now my question is why the output is changing with the system time?