1
考慮followign代碼:將毫秒數值轉換爲日期?
public void convertTime()
{
DateFormat df = new SimpleDateFormat(dateFormat);
Date date;
Date date2;
date = df.parse("15/01/2010 21:58:54");
date.getTime(); //produces 1263585534000
date2 = new Date(date.getTime()); //this is ok, compiles
date2 = new Date(1263585534000); //gives an error: The literal 1263585534000 of type int is out of range
}
我不知道如何可以將這個長數字變成日期格式,爲什麼會出現這個錯誤?
謝謝
謝謝你的答案! – 2010-11-11 14:28:28