fixes to date funcs