java將時間戳轉(zhuǎn)化為時間格式 時間戳轉(zhuǎn)工具使用方法?
時間戳轉(zhuǎn)工具使用方法?1. 打開時間戳轉(zhuǎn)換工具,輸入整數(shù)型時間戳,點擊[time seconds time string]按鈕,將時間戳轉(zhuǎn)換成日期時間2。以通用格式輸入日期和時間,然后單擊[time
時間戳轉(zhuǎn)工具使用方法?
1. 打開時間戳轉(zhuǎn)換工具,輸入整數(shù)型時間戳,點擊[time seconds time string]按鈕,將時間戳轉(zhuǎn)換成日期時間
2。以通用格式輸入日期和時間,然后單擊[time string time seconds]按鈕將日期時間轉(zhuǎn)換為時間戳
public static void main(string[]args)拋出parseexception{string]time=“2015-10-08 17:00:00”SimpleDateFormat sdf=new SimpleDateFormat(“yyyy-MM-dd HH:MM:ss”)java.util.Date文件日期uUtil=解析sdf.parse(time)//轉(zhuǎn)換為util.datejava.sql.Date Date sql=新建java.sql.Date日期(日期)使用時間())//轉(zhuǎn)換為sql.dateSystem.out.println(日期util)系統(tǒng)輸出打?。╠ate_uql)字符串日期=sdf.format格式(日期)系統(tǒng)輸出打印(日期)日期=sdf.format格式(使用日期)系統(tǒng)輸出打?。ㄈ掌冢﹠