Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

AIX Timezone problem, Java showing one hour less

807580Aug 13 2009 — edited Sep 26 2009
import java.util.*;
class PrintDate{
public static void main(String args[])
{
Date d=new Date();
System.out.println(d);
System.out.println(TimeZone.getDefault());
}
}
The output of the program and the shell command 'Date' are differed by one hour, did anybody face this problem. What can be the solution.?

$ java PrintDate
Thu Aug 13 09:02:21 GMT+05:30 2009
sun.util.calendar.ZoneInfo[id="GMT+05:30",offset=19800000,dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
$ date
Thu Aug 13 10:02:36 IST 2009
$ echo $TZ
IST-5:30IST
Edited by: RaghuD on Aug 12, 2009 10:03 PM

Edited by: RaghuD on Aug 12, 2009 10:03 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 24 2009
Added on Aug 13 2009
1 comment
404 views