time.java
来自「图书馆的图书管理系统! 图书查询」· Java 代码 · 共 22 行
JAVA
22 行
package labraryManager;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.*;
import java.text.*;
public class Time {
public static long getCurrentTimeMillis() {
return System.currentTimeMillis();
}
public static Date getCurrentDate() {
// return new Date(System.currentTimeMillis());
return new Date(getCurrentTimeMillis());
}
public static String getCurrentFormatDate() {
Date currentDate = getCurrentDate();
SimpleDateFormat dateFormator = new SimpleDateFormat(
"yyyy-MM-dd");
return dateFormator.format(currentDate);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?