Questions

How to convert Timezone into specified formate?

Tags:
+
0 Votes
Locked

How to convert Timezone into specified formate?

unamepwd786
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)....
  • +
    0 Votes
    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.

  • +
    0 Votes
    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.