Java tutorial
//package com.java2s; import java.text.ParseException; import java.text.SimpleDateFormat; public class Main { public static boolean isLoadAd() { long currentTimeMillis = System.currentTimeMillis(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); try { long limitTime = simpleDateFormat.parse("2018-04-21").getTime(); return currentTimeMillis > limitTime; } catch (ParseException e) { e.printStackTrace(); } return false; } }