Quantcast
Channel: Excel Data Reader - Read Excel files in .NET
Viewing all articles
Browse latest Browse all 448

New Post: Not a legal Ole Aut date

$
0
0
Ok, I managed to get the source downloaded and fixed the problem in the following routine by range checking the DateTime.FromOADate values from the MS documentation, following the line "added to fix out of range problem, sdh, 20140826":
    public static object ConvertFromOATime(double value)
    {
        if ((value >= 0.0) && (value < 60.0))
        {
            value++;
        }
        //if (date1904)
        //{
        //    Value += 1462.0;
        //}

      // added to fix out of range problem, sdh, 20140826
      if (value < 657435.0)
      {
        value = 657435.0;
      }
      else if (value > 2958465.99999999)
      {
        value = 2958465.99999999;
      }
        return DateTime.FromOADate(value);
    }

Let me know how you would like to handle this.

Viewing all articles
Browse latest Browse all 448

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>