从Excel工作表中读取日期列 [英] Reading Date column from an excel sheet

查看:109
本文介绍了从Excel工作表中读取日期列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用openxml来读取Excel工作表。我有一些日期时间类型的列。但是,当我读取日期列时,它显示了以某种其他格式转换的值,这些格式无法作为日期时间检测到。当使用open xml读取excel文件时,有人可以帮我检测datetime列吗?



非常感谢。

解决方案

Excel日期和时间存储为浮点值,其中整数部分是自纪元以来的天数,小数部分是午夜过后的秒数。请参见此链接 [ ^ ](及其他许多人)了解详情。


查看此链接我将对您有所帮助



http://stackoverflow.com/questions/13176832/reading-a-date-from-xlsx-using-open-xml-sdk?answertab=active#tab-top

I am using openxml to read excel sheets. There i have some columns of datetime type. But when I read date column it shows me value converted in some other format that is not detectable as datetime. Can anybody help me in detecting datetime column, when reading excel file using open xml?

Big Thanks.

解决方案

Excel dates and times are stored as floating point values where the integer portion is the number of days since the epoch, and the decimal portion is the number of seconds past midnight. See this link[^] (and many others) for details.


See This link i will helpful for you

http://stackoverflow.com/questions/13176832/reading-a-date-from-xlsx-using-open-xml-sdk?answertab=active#tab-top


这篇关于从Excel工作表中读取日期列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆