jxlフェッチ日付

次のコードは、日付を正しく取得するためのものです。

        jxl.Cell[] cell = null;
        Date transferDate = null;
        DateCell dc = null;
        Date date = null;
        Calendar c = null;
        Out cio = new Out();
              if (cell[0].getType() == CellType.DATE) {
                        dc = (DateCell) cell[0];
                        date = dc.getDate();
                        c = Calendar.getInstance();
                        c.setTime(date);
                        c.add(Calendar.HOUR, -8);
                        transferDate = c.getTime();
                        cio.setDate(transferDate);
                        cio.setDateStr(dftdate.format(transferDate));
                    }

 

元の記事を51件公開 いいね4 ビジター7886

おすすめ

転載: blog.csdn.net/u012174809/article/details/103314034