UTC 转本地时间

String dateStr = "Wed Dec 10 00:00:00 UTC 0800 2014"; //Wed Dec 10 00:00:00 UTC 0800 2014

    SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss 'UTC' yyyy",Locale.US);
   

    try { 
        Date date = (Date) sdf.parse(dateStr); 
        String formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date); 
        System.out.println(formatStr); 
    } catch (ParseException e) { 
        e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates. 
    }
原文地址:https://www.cnblogs.com/cpsing/p/4156370.html