Results 1 to 2 of 2

Thread: check if a date type is null

  1. #1

    Default check if a date type is null

    anyone knows how? if its empty or null?

    events.get(x).getOccurredDate() == null

    thats not working. neither

    events.get(x).getOccurredDate().equals("")

  2. #2
    Join Date
    Jan 2006
    Location
    Seattle, Washington
    Posts
    467

    Default

    I think you're going to have to elaborate on your question.

    You're talking about a "java.util.Date" object? You want to know when it's null? You simply check for "object == null" in a conditional statement like "if". If the object is null, that will be true. It doesn't make sense to ask if a Date object is "empty", it's not like a String object.

    If you say something "isn't working", then tell us exactly what happens and why you think it's not working.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •