Check for valid timestamp input, thanks to Brion for pointing this out.