move timestamp code to template helper