Program in Java to convert a date to serial number as done in Excel

前端 未结 3 2027
感动是毒
感动是毒 2020-12-22 09:41

I have written a function but it does not give an actual O/P...

public int date(Object O) {
    if (O instanceof Date) {
        Date d1 = (Date) O;
                 


        
3条回答
  •  情书的邮戳
    2020-12-22 10:26

    The right algorithm is already implemented in Apache POI. Take a look at class org.apache.poi.ss.usermodel.DateUtil.

    Also this description could be useful: http://support.microsoft.com/kb/214094/en-us

提交回复
热议问题