ISODateTimeFormat 转换2019-08-15T00:36:49.366456463Z 日期格式


import java.text.*;
import java.text.SimpleDateFormat;
import java.util.*;

import org.joda.time.DateTime;
import org.joda.time.format.ISODateTimeFormat;

/**
 * Created by sixinshuier on 2019/08/15
 */
public class Test {

    public static void main(String args[]) throws ParseException {
        DateTime date = ISODateTimeFormat.dateTime().parseDateTime("2019-08-15T00:36:49.366456463Z");
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
        Date time = df.parse(date.toString());
        SimpleDateFormat df1 = new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy", Locale.UK);
        Date date1 = df1.parse(time.toString());
        DateFormat df2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String str = df2.format(date1);
        System.out.println(str);
    }
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM