totimestamp function recast