generalize timestamp parsing