开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜