text: public static double GetExcelDate(DateTime date, bool use1904windowing){if ((!use1904windowing && date.Year < 1900)  || (use1904windowing && date.Year < 1904))   {return BAD_DATE;}DateTime startdate;if (use1904windowing){startdate = new DateTime(1904, 1, 1);}else{startdate = new DateTime(1900, 1, 1);}double value = (date - startdate).TotalDays + 1;if (!use1904windowing && value >= 60){value++;}else if (use1904windowing){value--;}return value;}