getdate: correctly specify error number