java current time in seconds code example
Example 1: java get current time in seconds
LocalDateTime date = LocalDateTime.now();
int seconds = date.toLocalTime().toSecondOfDay();
Example 2: java how to get current time
import java.util.Calendar;
Date currentTime = Calendar.getInstance().getTime();