Parse timestamp if it is a string.