ava怎樣將"1413863429"字符串轉換成datetime格式

.....通常來講應該是一個 毫秒數 String str ="1413863429";        Long timeLong = Long.parseLong(str);        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");        Date date = sdf.parse(sdf.format(timeLong)); //你要的日期格式        System.out.println(sdf.format(date));1970-01-17 16:44:23
相關文章
相關標籤/搜索