try to get the date function right