In my code there is a function which will be called once every 2 months by me. I would like to make it impossible to call it more often than once every 2 months for some security reasons.
I found out that I can store time and in the very beginning of the function simply add assert until time gets greater than variable, and when function goes complete, it stores current time + 2 months to the variable.
It's pretty simple, but is it safe? Can time be anyhow hacked or written by block miners? Or maybe is there any other way to make it possible to lock function for specific amount of time?