When I executing 'date' command in the terminal it display the result like this
[fuel@H00170a ~]$ date
Wed Aug 21 05:19:59 CDT 2013
This is the code am using in Java file
System.out.println( "TIME-ZONE:" + TimeZone.getDefault() );
System.out.println("Date in Java " + new Date( ));
Output comes like below:
Date in Java Wed Aug 21 10:59:48 GMT 2013.
System date shows time as Wed Aug 21 05:19:59 CDT 2013 where as the time in java is Wed Aug 21 10:59:48 GMT 2013.
What needs to be done for java to time same as system date ie, Wed Aug 21 05:19:59 CDT 2013.
Some more information related to my environment.
The java application is running on a dump client. When the dump client boots up, it download OS, jre and all related software required to run the application from a Linux server machine using tftboot. The dump client does not have a connectivity to time server. So we use a program which will fetch time from the server machine and set that time to local machine before the tftboot installs jre on the client machine. Why we setting the time from server machine is because the dump client was initializing with wrong time and date. The year in the date was 2001.