Wednesday, August 10, 2011

How do I convert a date from Excel to a DateTime in C#?

Dates are stored in Excel as Julian dates - with a base date of 1/0/1900 (that's the zeroth day, not a typo). Fractions are time - 0.25 is 6AM. Do the conversion in C# or add a column and do the conversion to text in Excel and use that column. (Formatting in Excel changes how the data is displayed, it doesn't change how it's stored.)

No comments:

Post a Comment