Move timestamp code to extra class

Signed-off-by: Michael Buesch <m@bues.ch>