forked from fanruan/finekit
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
769 B
29 lines
769 B
package com.fanruan.api.util; |
|
|
|
import com.fr.general.DateUtils; |
|
|
|
import java.util.Date; |
|
|
|
public class DateKit { |
|
/** |
|
* 将字符串转化为日期 |
|
* |
|
* @param str 字符串 |
|
* @param returnNull 转化失败的时候是否返回null |
|
* @return 将字符串转化为相应的日期值 |
|
*/ |
|
public static Date string2Date(String str, boolean returnNull) { |
|
return DateUtils.string2Date(str, returnNull); |
|
} |
|
|
|
/** |
|
* 取得某日期时间的特定表示格式的字符串 |
|
* |
|
* @param format 时间格式 |
|
* @param date 某日期(Date) |
|
* @return 某日期的字符串 |
|
*/ |
|
public static String getDate2Str(String format, Date date) { |
|
return DateUtils.getDate2Str(format, date); |
|
} |
|
}
|
|
|