package com.trackingio.util;


import java.text.SimpleDateFormat;
import java.util.Date;


public class Tools {

    public static String getCurrentDate(int digit,String connector){

        String date =  "";

        if(digit==8 && connector.equals("")){

            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");

            date = dateFormat.format(new Date());

            return date;

        }else if(digit==10 && connector.equals("-")){

            SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

            date = dateFormat.format(new Date());

            return date;

        }else{
            System.out.println("The data format you want is invalid");
            return date;

        }



    }
}
