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);
    }
}

 

转载于:https://www.cnblogs.com/shix0909/p/11365052.html

你可能感兴趣的:(ISODateTimeFormat 转换2019-08-15T00:36:49.366456463Z 日期格式)