Density functional theory predictions of anharmonicity and spectroscopic constants for diatomic molecules