zoukankan      html  css  js  c++  java
  • 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. 
        }
  • 相关阅读:
    Jquery入门
    微服务
    数组
    流程控制
    GO的整型
    Go的巧记
    变量和常量
    Golang
    股票入市指南
    linux 命令行操作
  • 原文地址:https://www.cnblogs.com/cpsing/p/4156370.html
Copyright © 2011-2022 走看看