added time function same as date function