btnPlayAgain.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
newGame();
}
});
public static void main(String[] args) {
long leftLimit = 0L; // 01/01/1970, 00:00
long rightLimit = Instant.now().toEpochMilli(); // now
long generatedLong = leftLimit + (long) (Math.random() * (rightLimit - leftLimit));
var randomDate = Instant.ofEpochMilli(generatedLong);
DateTimeFormatter formatter =
DateTimeFormatter.ofLocalizedDateTime( FormatStyle.SHORT )
.withZone( ZoneId.systemDefault() );
System.out.println( formatter.format( randomDate ));
}
Это тупое решение?