id="info"

Question

Locked

How to convert Timezone into specified formate?

By 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)....

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Note that you have uppercase and lowercase Z

by robo_dev In reply to How to convert Timezone i ...

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.

Back to Software Forum
2 total posts (Page 1 of 1)  

Software Forums