Fix oracle timestamp conversion

Ported fix from 3.1.