Modify mktime function to time function