Convert the Excel custom time format to a timest format

2023-03-18  

// Date Added days
    public String dayAddition(int num) {  

        try{

            SimpleDateFormat timeformat = new SimpleDateFormat(“yyyy-MM-dd”);  

            java.util.Date date = timeformat.parse(“1900-01-01”);  

            Calendar a = Calendar.getInstance();  

            a.setTime(date);  

            a.add(Calendar.DATE, (num-2));  

            return timeformat.format(a.getTime());  

        } catch(Exception e){

            return “”;

        }

        

    }

source

Random Posts

“Inspur Cup” Eighth ACM University Student Program Design Competition G

linux installation JDK complete steps

zabbix API to get the value of all hosts and monitoring items

WORDPRESS how to compress the html code

Determine whether to long press a certain button