Fixing check for a valid timestamp

Fixing implementation of isValidTimestamp to correctly validate for a valid timestamp, based on suggestions here: http://stackoverflow.com/questions/3377537/checking-if-a-string-contains-an-integer/3377560#3377560