DateTime Question?


#1

We use Cells.ExportDataTable() to export data,
one of these columns is user-defined type --> yyyy/M/d hh:mm:ss.
Then the data of cell we get is wrong.
Original data is 2005/12/21 12:00:00
We read it show as 2005/12/21 :00:00.

And if the cell type is normal DateTime, we can't read seconds.
Original value is 2005/12/12 12:03:22
but we read it as 2005/12/12 12:03

please help us, thanks


#2

I will check the first issue.

For second issue, please check the format string of cell B12 in "Master" worksheet. It's "yyyy-m-d h:mm" which doesn't show the seconds.


#3

I also didn't find the first problem. In Cell B11 of "Master" worksheet, the data is also 2005/12/21 00:00:00.

Could you please post your sample code here and describe your need with more detail information? Thank you.


#4

Thanks for your test, We want to get block data from excel, so we use Cells.ExportDataTable().
Our customers may use user-defined type to save data,
like yyyy/m/d hh:mm:ss.
If our application to read that cell, it always get wrong data.
Give you our test code and result ,and thanks again.


#5

this is result.jpg

by the way , Merry Chrismas !!


#6

Merry Christmas and Happy New Year!

Please try this attached fix.


#7

This is my screenshot for your file and output result.


#8

It’s ok,thanks so much !!