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

你可能感兴趣的:(时间)