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!

Indonesia TimeZone Issue

807589Sep 30 2008 — edited Sep 30 2008
All,
I am getting different time zone for Asia/Jakarta.

Code
=====

String tz = "Asia/Jakarta";
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm z");
dateFormat.setTimeZone(TimeZone.getTimeZone(tz));
String statusDate = dateFormat.format(new Date());
System.out.println(statusDate);

SimpleDateFormat dateFormat1 = new SimpleDateFormat("dd/MM/yyyy HH:mm Z");
dateFormat1.setTimeZone(TimeZone.getTimeZone(tz));
String statusDate1 = dateFormat1.format(new Date());
System.out.println(statusDate1);

Output
01/10/2008 01:17 WIT
01/10/2008 01:17 +0700


WIT should be UTC+9 not UTC+7 which is WIB.

Please check the below link
http://en.wikipedia.org/wiki/Time_in_Indonesia
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 28 2008
Added on Sep 30 2008
6 comments
749 views