getTime refactoring

Some refactoring of getTime() functions.
What's this gonna do?