I use next code to print current time
Calendar cal = Calendar.getInstance();
System.out.println(cal.getTime());
I have Windows XP sp3 istalled. Current time in system tray is 14:30. But this code return 13:30
Why returned time is wrong?
I use next code to print current time
Calendar cal = Calendar.getInstance();
System.out.println(cal.getTime());
I have Windows XP sp3 istalled. Current time in system tray is 14:30. But this code return 13:30
Why returned time is wrong?
The default time zone used by java is probably different than the one configured in your OS. call cal.getTimeZone() to check the time zone. You can also set it with cal.setTimeZone(..).