Created time helper functions

Should not be merged yet.
Thanks, @williampma. I totally overlooked that. :)