本来以为得到GMT时间很简单,通过Calendar 
date = Calendar.getInstance(TimeZone.getTimeZone(“GMT”));然后
date.getTime()就是,但是实际的结果不是,要得到GMT时间还是需要转换下的,以下是得到当前的GMT时间:
    public static Date getGMTDate ()
    {
        Calendar calendar = Calendar.getInstance();
        int offset = calendar.get(Calendar.ZONE_OFFSET)/3600000 +
               
calendar.get(Calendar.DST_OFFSET)/3600000;
        calendar.add(Calendar.HOUR,-offset);
        return calendar.getTime();
    }

(Visited 116 times, 1 visits today)