The problem is that your id card is going invalid within one millisecond. [Wow!] getTime returns the long in milliseconds from 1990. [I think], you should be checking that the end date of the id is...