All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.lfopenjavaswagger2word.util.DateUtils Maven / Gradle / Ivy

There is a newer version: 1.0.2-RELEASE
Show newest version
package com.github.lfopenjavaswagger2word.util;

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

/**
 * @author : Mr huangye
 * URL : CSDN 皇夜_
 * createTime : 2020/7/18 10:39
 * Description :
 */
public class DateUtils {

    /**
     * 获取当前时间
     * @param fmt 时间格式:例如 yyyy-MM-dd HH:mm:ss
     * @return
     */
    public static String now(String fmt) {
        SimpleDateFormat dateFormat = null;
        if (fmt == null || fmt.equals("")) {
            dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        }
        Date date = new Date();
        String format = dateFormat.format(date);
        return format;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy