将日期的数字表示形式转换为java中的Date [英] Converting Number representation of Date in excel to Date in java
问题描述
示例
Excel日期
1/1/2013
正如
41275.00
如何在我的Java应用程序中转换号码?
Apache POI有一些实用程序 http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/DateUtil.html ,特别是 http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/ DateUtil.html#getJavaDate(double)
注意Excel将日期存储为自1900年以来的天数(加上小数天)(在某些情况下,它可以来自1904年)。请参阅 http://support.microsoft.com/kb/180162 。
I have date column in excel, but when I'm reading in my java application I'm getting value as number
Example
Excel Date
1/1/2013
Am getting as
41275.00
How to convert number to date in my Java application?
Apache POI has some utilities for that http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/DateUtil.html, notably http://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/DateUtil.html#getJavaDate(double)
Note Excel stores dates as the number of days (plus fractional days) since 1900 (and in some cases it can be from 1904). See http://support.microsoft.com/kb/180162.
这篇关于将日期的数字表示形式转换为java中的Date的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!