把它作为input到java程序的excel表值

我希望excel表单值作为我的程序的input,但24小时的时间格式在程序运行后12小时格式改变。例如:Excel包含23:34:10但是当我在netbean中运行程序,输出是11:34:10.我想要23:34:10作为输出。

public class DateTime { public static void main(String[] args) throws Exception{ File f=new File("D:\\BCCIDT.xls"); Workbook wb=Workbook.getWorkbook(f); Sheet s=wb.getSheet(0); int row=s.getRows(); int col=s.getColumns(); for(int j=0;j<row;j++){ Cell c=s.getCell(0, j); System.out.println(c.getContents()+"\n"); String msg=c.getContents(); Date date = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").parse(msg); String newString = new SimpleDateFormat("kk").format(date); System.out.println("Time = " + newString +"\n"); } } } 

input是-23:00:35输出-11:00:35

但是我想输出23:00:35

请检查SimpleDateFormat(..)的模式。 试试SimpleDateFormat("HH:mm:ss")