In that code above I want to transform a Date by the TimeZone of Server (GMT-02:00) to TimeZone from my Device (GMT-03:00). But I Always have the same Date of the server. What I
What I doing wrong?
You're assuming that a Date
has a time zone to start with. It doesn't. A Calendar
does, but a Date
is just milliseconds since the Unix epoch. It doesn't know about calendar systems or time zones. It's just a point in time.
It's not clear what you want to do with the result - but if it's a matter of formatting it for display, just use SimpleDateFormat
and set the time zone on that instead.
I would also strongly recommend that you use Joda Time instead of the built-in types... it's a much more sensible API.