If run this code in windows machine, its works properly:
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(sdf.format(new Date()));
It shows date & time same as clock, but the same code if I run on Windows Server it's showing -2hrs of clock time.
I tried by the setting the timezone as,
TimeZone timeZone = TimeZone.getTimeZone("Europe/Vienna");
sdf.setTimeZone(timeZone);
Then, it shows same as clock time.
My doubt is why is it not taking the clock time zone by default in Windows Server.