Android Time Zone UTC to current conversion not working
Im trying to convert a given date formated in UTC timezone and then converting to the current timezone. But its not working properly, here's the code:
public String CurrentTimeZone(Date value){
SimpleDateFormat sdf= getReaderFormatter();
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
sdf.format(value);
return getCur开发者_StackOverflow社区rentTimeZone().format(value);
}
The problem is that the date value still remains in the current time zone after formating it with the UTC one, so the conversion ends up being from "current timezone -> current timezone" and not UTC timezone -> current timezone....
精彩评论