Not really. You could try to encrypt the local variable and that would deter most people. The problem there is, any password you use to encrypt and decrypt it would be located somewhere in the code. Anyone dedicated enough would eventually find a way to decrypt it. (Trust me, I've had keygens made for software I've written).
I'm doing something very similar to what you are. I have skills that require x amount of time before they can be trained. What I do is send an AJAX request to a PHP file when they choose a skill to train. When it gets that request it stores that timestamp in a MySQL database. When the user logs in, it sends an AJAX request to retrieve that timestamp. It compares it to the current timestamp and if enough time has elapsed, it sends another AJAX request to update their skills. If the time hasn't elapsed, I have a 1 sec timer on a global event sheet that keeps checking to see if that time has elapsed.
But, you even have to take other things into account. What if they change the clock on their computer to be say, a week in the future? You'd need some way to validate the current time.
If people want to hack your game, they will. All you can do is make it as difficult as possible. My solution isn't perfect but, storing things like that remotely on a server is about the best you can hope for.