I am try to get the current date/time in in following format,
SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd G 'at' HH:mm:ss z");
// should display something similar to 2001.07.04 AD at 12:08:56 PDT
Calendar calendar = Calendar.getInstance();
calendar.set(2009, 2, 4, 10, 22, 44);
format.format( calendar.getTime() );
System.out.println(calendar.getTime());
But it display as Wed Mar 04 10:22:44 IST 2009.
The second question is I want to see the milliseconds value of the set time.
System.out.println(calendar.getTimeInMillis());
But it always return the current times milliseconds value and not the time I set earlier.
What is I am missing here?