How to count time and put it in an SD card

Indeed, I can not do it in void loop since i want one data that has to increment.

No it is called the loop function, void is simply the type of variable the function returns, it is not part of the name.
And No you can do it in the loop function, so post what code you have and try and explain better what you are trying to do.