Convert timestamps to seconds