Java Date Detection


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <% java.util.Date today = new java.util.Date(); java.util.Date ad = new java.util.Date("May 25, 2010 12:00 AM");%>
  2. <% if (today.compareTo(ad) > 0){ %>
  3. Displays after date
  4. <%} else {%>
  5. Displays before date
  6. <% } %>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.