|
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));
The
System.out.println(s); |
|