Question Locked

How to convert Timezone into specified formate?

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Actually my java code like this.....
Ex:
SimpleDateFormat sourceFormat = new SimpleDateFormat("z");
SimpleDateFormat gmtFormat = new SimpleDateFormat("'GMT('Z')'");
date1 = gmtFormat.format(sourceFormat.parse("IST"));

O/p:GMT(+0530) for example we are passing "PST" it will show GMT(-0800) but my example will show always GMT(+0530)....

2 replies

by robo_dev

Those are not the same variables, JAVA is case sensitive

If a substitution variable is not working, two thoughts:

Is the variable declared properly?
Insert some code to display the variable value to make sure the value is what you expect.

This discussion is closed to new replies.