main with date function