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

com.wujiuye.hotkit.json.util.DateUtils Maven / Gradle / Ivy

Go to download

hotkits项目集合中的一员,JSON适配器组件,让切换JSON解析框架只需要切换依赖包即可。

The newest version!
package com.wujiuye.hotkit.json.util;

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

/**
 * @author wujiuye 2020/04/23
 */
public class DateUtils {

    /**
     * 日期转字符串
     *
     * @param date    日期
     * @param pattern 日期格式
     * @return
     */
    public static String dateToString(Date date, String pattern) {
        String returnValue = "";
        if (date != null) {
            SimpleDateFormat df = new SimpleDateFormat(pattern);
            returnValue = df.format(date);
        }
        return (returnValue);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy