CompletableFuture
Future
public long getFromDateTest(){ SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd"); try { return df.parse(df.format(new Date())).getTime()/1000L; } catch (ParseException e) { //Will not happen } return System.currentTimeMillis()/1000L; }