java new Date() problem
I am not able to get the System date and Time using new Date();
What might be the problem , can someone give any idea, appreciate.
Ofcourse, i can set the TimeZone(), it works . I don't want to set anything. I just want to get the System Date. How to get that.
This gives the correct value...
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
java.util.Date date = new java.util.Date();
String datetime = dateFormat.format(date);
System.out.println("Current Date Time : " + datetime);
Presnetly i am using the same one. Not working. Actually it suppose to give the SGT time. new Date() is giving GMT time.