.net - Determine if an IXLCell is using a DateTime format -


all,

in .net, i'm using closedxml read in uploaded excel file , converting cells 2d array of strings. end goal modify cells , display modified cells user.

i'm having trouble handling cells store datetime values. weirdly, when read cell's data type, returns xlcellvalues.number (not xlcellvalues.datetime, expect). i've found excel stores datetimes doubles metadata saying convert date, might explain issue.

i'm wondering if knows of way, using closedxml, check if excel cell's value datetime type? and, if so, how can convert value .net datetime?

thanks!

without looking @ file i'd cause cell contain number formatted date. valid in excel, in fact dates stored numbers.

use following check if cell contains date:

datetime date; if (cell.trygetvalue(out date)) {     // got date } 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -