I want to add 25 years more to the date of birth field.
maxage is a int field of value 25.
if(table1.getregister_date() >= (employee.getdate_of_birth() + maxage))
//do something
want to know can i add and compare date fields this way??
I want to add 25 years more to the date of birth field.
maxage is a int field of value 25.
if(table1.getregister_date() >= (employee.getdate_of_birth() + maxage))
//do something
want to know can i add and compare date fields this way??
It depends on the type that employee.getdate_of_birth()
returns. If its a LocalDate
, you can do employee.getdate_of_birth().plusYears(maxage)
. There are similar methods for days, months and seconds.