datetime object/string function to calc timedelta