package com.walker.jdbc.generator.util;
|
|
import java.text.SimpleDateFormat;
|
import java.util.Date;
|
|
public class DateUtils {
|
|
public static final String DATE_PATTERN = "yyyy-MM-dd";
|
public static final String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
|
|
public static String format(Date date)
|
{
|
return format(date, "yyyy-MM-dd");
|
}
|
|
public static String format(Date date, String pattern) {
|
if (date != null) {
|
SimpleDateFormat df = new SimpleDateFormat(pattern);
|
return df.format(date);
|
}
|
return null;
|
}
|
}
|