String字符串轉成Date格式

實例

s[6] 爲字符串    

SimpleDateFormat sDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
    tDeviceAddOrderDetailDto.setDistributeExpressTime(sDateFormat.parse(s[6]));
} catch (ParseException e) {
    e.printStackTrace();
}

 

 

 

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