moved get_date function