refactor-out timestamp conversion code, allow for millisecond accuracy

i'd double check this. it was developed on windows :-)