public static double getExcelDate(LocalDateTime date, boolean use1904windowing) {int year = date.getYear();int dayOfYear = date.getDayOfYear();int hour = date.getHour();int minute = date.getMinute();int second = date.getSecond();int milliSecond = date.getNano()/1_000_000;return internalGetExcelDate(year, dayOfYear, hour, minute, second, milliSecond, use1904windowing);}

public static double getExcelDate ( LocalDateTime date , boolean use1904windowing ) { int year = date . getYear ( ) ; int dayOfYear = date . getDayOfYear ( ) ; int hour = date . getHour ( ) ; int minute = date . getMinute ( ) ; int second = date . getSecond ( ) ; int milliSecond = date . getNano ( ) / 1_000_000 ; return internalGetExcelDate ( year , dayOfYear , hour , minute , second , milliSecond , use1904windowing ) ; }
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;}
