com.wujiuye.hotkit.json.util.DateUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hotkit-json Show documentation
Show all versions of hotkit-json Show documentation
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