my java program want TimeZone like GMT(+0530) instead of getting IST
Actually my java code like…
String date1=null;
String formate="IST";
SimpleDateFormat sourceFormat = new SimpleDateFormat("z");
SimpleDateFormat gmtFormat = new SimpleDateFormat("Z");
date1 = gmtFormat.format(sourceFormat.parse(formate));
System.out.println(date1);//output +0530
Problem 1:but Actually i want this format GMT(+0530)
Problem 2:The above code working only passing IST giving +0530 and any zone like EAT,PST also giving +0530 only,… but the time will changed PST = (GMT - 8:00)
Please give suggestions…
To Print format like
GMT(+0530)use pattern'GMT('Z')'instead ofZ.