📄 80c2087a590c001d1f9e8316f26add13
字号:
package com.lib.biz;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.lib.cls.InDate;
import com.lib.cls.PrintDate;
public class SetDate {
public static Date SetPrintDate(PrintDate prD){
Date date = new Date();
try {
date = new SimpleDateFormat("yyyy-MM-dd").parse(prD.getYear()+"-"+prD.getMonth()+"-"+prD.getDay());
} catch (Exception e) {
System.out.println("出版日期格式错误");
}
return date;
}
public Date SetInDate(InDate inD){
Date date = new Date();
try {
date = new SimpleDateFormat("yyyy-MM-dd").parse(inD.getYear()+"-"+inD.getMonth()+"-"+inD.getDay());
} catch (Exception e) {
System.out.println("出版日期格式错误");
}
return date;
}
public static void main(String[] args) {
PrintDate prid = new PrintDate();
prid.setDay("12");
prid.setMonth("02");
prid.setYear("2002");
Date date = SetPrintDate(prid);
System.out.println(date);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -