Something like that is in principle easy but there are a few tricky parts I can think of.
One is how accurate you need the 2 years to be.
Another is an issue of reliable power for the entire 2 year duration. If you lose power, you
loose your timer, unless you design something with battery back-up. And if the device is to
be battery powered, ensuring the battery lasts that long will require careful power management.
Maybe you could program your cell phone to do the job?