3 Replies Latest reply on May 20, 2009 4:55 PM by Ambrish Singh

    Comparing dates

    Jon Kleiser Newbie

      In our Seam web application we need to render certain elements in our xhtml pages only if the current date is after (or before) some specified date. We've tried things like this: deadlineDate.after(currentDate)
      The problem with this is that our deadline dates typically have 00 hours (00:00:00), while currentDate is (I believe) down to the seconds. If deadlineDate is 05/20/2009 00:00:00, and currentDate is 05/20/2009 16:02:03, then the 'after' method returns false, and the effect is as if we've passed the deadline. What we really want is to compare a truncated currentDate against a (truncated) deadline. Is there a nice and easy way to do that?