Fixed output of date function