date function added