We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@pangwu86 Flash_Sale.xlsx 文件里面的 开始时间 和结束时间 两列配置的整点时间 转换后出现了2018-05-09 09:59:59 但里面配置的都是整点的数据
2018-05-09 09:59:59
@J4EName("flash_sale") public class FlashSale { @J4EName("开始时间") private String from; @J4EName("结束时间") private String to; @J4EName("商品ID") private long itemId; @J4EName("skuID") private long skuId; @J4EName("闪购价") @J4EDefine(precision = 2) private float price; public String getFrom() { return from; } public void setFrom(String from) { this.from = from; } public String getTo() { return to; } public void setTo(String to) { this.to = to; } public long getItemId() { return itemId; } public void setItemId(long itemId) { this.itemId = itemId; } public long getSkuId() { return skuId; } public void setSkuId(long skuId) { this.skuId = skuId; } public float getPrice() { return price; } public void setPrice(float price) { this.price = price; } }
code
File outFile = Files.createFileIfNoExists2(Disks.normalize("Flash_Sale.xlsx")); List<FlashSale> list = J4E.fromExcel(Streams.fileIn(outFile), FlashSale.class, null); for (FlashSale flashSale : list) { String fromStr = flashSale.getFrom(); Date from = SaudiTime(fromStr); String toStr = flashSale.getTo(); System.out.println(fromStr + " ," + toStr ); } }
The text was updated successfully, but these errors were encountered:
嗯,下午me查查
Sorry, something went wrong.
@pangwu86 搞出来了没 ?
excel里实际存储的是日期类型 ,poi接口拿到的就是你最终看到的有整点有59的,看了下poi的实现,里面实际存储的是个double类型 然后转成日期,但为什么字面上一样的日期读取来的double不一样 这个还在查
@Rekoe 目前看这个应该是POI的bug,excel存储时那个字段设置成日期类型 在poi里就只能以double类型读取到 poi读出来的就是差1s也是无法让人理解
me推荐你如果这个读取的excel是你能控制的,那就是保存日期时用字符串类型
No branches or pull requests
@pangwu86
Flash_Sale.xlsx
文件里面的 开始时间 和结束时间 两列配置的整点时间 转换后出现了
2018-05-09 09:59:59
但里面配置的都是整点的数据code
The text was updated successfully, but these errors were encountered: