Datetime validation fix