添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
K. Tsang wrote: SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd yyyy HH:mm:ss Z");



No it doesn't work
parseDateError.png
What value does you pass into the 2nd parameter for the parse() method? And not sure if the locale for the SimpleDateFormat is affecting it, you may want to remove the locale to test .

EDIT forget the 2nd parm in parse().
Guess what the format I gave earlier doesn't work.
new SimpleDateFormat("EEE MMM dd HH:mm:ss Z yyyy");

Does your code print out the date on line 7? Is tblSalesDetail.getValueAt(i,3) even a Date?
It's a string alright. The table model can't be wrong right?

The weird thing I don't why this code doesn't work for you.

Then your table model isn't returning the correct type.

EDIT: if it's Object, what does your instanceof operator say? Is it possible to cast it directly to java.util.Date?