You can perform math on dates directly and then format those durations. The Date Formatting section of the Date Functions in Rule Expressions help article describes some of the formatting functions.
Keep in mind that to perform math on dates or to format them as durations, they must be in date/millis format, not strings. So be sure to use the date() function to parse them if necessary.
For example, humanizeDuration() gives you a human friendly version of the duration. It automatically does some rounding and other things to make things more human friendly, so depending on the level of accuracy you’re looking for, you may prefer one of the other solutions where you have more control over the formatting.
Keep in mind that with durationAs(), you’ll often want to wrap it in a round() function as it’s going to give you the raw result with full decimal precision. So 22 days duration as ‘weeks’, would be 3.1428... weeks whereas you might only care that it’s 3 weeks or 3.1 weeks or whatever level of precision you’re looking for.