split macro_timedelta into two functions, unit tests