how to get current seconds in java 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();