Is there any problem with java Date() class it always gives me wrong time for example if my system time is 11 it gives me 12 (it always adds one hour to current system time). How could I solve this problem? I want date to give me the same time as system time.is this related to timezone? I’ve tried:
Calendar startingTime = Calendar.getInstance(TimeZone.getDefault());
System.out.println(startingTime.getTime());
and
System.out.println(new Date());
Thanks
This can be caused by one of two things:
Perhaps you could add the output of your
new Date()along with information about what you were expecting and where you are?