package com.gemho.meizhou.Util;


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

public class TimeUtils {

    private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");


    public static String timeValue(String time) {
        if (time.length() > 0) {
            time = time.substring(0, time.lastIndexOf("."));
            return time.replace("-", "")
                    .replace(" ", "")
                    .replace(":","");
        }else {
            Date date = new Date();
            return sdf.format(date)
                    .replace("-", "")
                    .replace(" ", "")
                    .replace(":", "");
        }
    }
}
