import java.text.SimpleDateFormat;
import java.util.Date;
public class DatetimeUtil {
public static String getNowDate() {
SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd");
Date date = new Date();
return time.format(date);
}
public static String getTheTimeInMinutes() {
SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date date = new Date();
return time.format(date);
}
public static String getTheTimeInSeconds() {
SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = new Date();
return time.format(date);
}
public static String getTheTimeInMilliseconds() {
SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
Date date = new Date();
return time.format(date);
}
}