Код: Выделить всё
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
public class GetCurrentDateTime {
private static final DateFormat sdf = new SimpleDateFormat("MM-dd");
public static void main(String[] args) {
Date date = new Date();
System.out.println(sdf.format(date));
}
}
Код: Выделить всё
08-16
31
Подробнее здесь: https://stackoverflow.com/questions/457 ... th-in-java
Мобильная версия