Java轉換時間格式2015-12-31T16:00:00.000Z

今年的格式爲2015-12-31T16:00:00.000Z,前端怎麼轉換都沒反應,只能在後臺接口裏轉啦,文章只是爲了備忘。

year = year.replace(“Z”,“UTC”); 
SimpleDateFormat format = new SimpleDateFormat(“yyyy-MM-dd'T'HH:mm:ss.SSS Z”); 
日期d = format.parse(年);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(“yyyy”); //
只要年份Date year_f = simpleDateFormat.format(d);

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章