date function debug