|
发表于 2020-6-14 08:30:02
|
显示全部楼层
java.util.Calendar c=java.util.Calendar.getInstance();
String s = "000";
String years = String.valueOf(c.get(java.util.Calendar.YEAR));
String days = String.valueOf(c.get(java.util.Calendar.DAY_OF_YEAR));
s = years.concat(s.substring(0,s.length()-days.length()).concat(days));
System.out.println(s); |
|