Weeks is the biggest component of time values. Anything above that (months, years) varies based on the date, and to keep the data type simple, scripting doesn't go as far as keeping track of a date. It's just a float formatted in descending order from weeks down to seconds, with seconds having the fraction part. Speaking of which, after a little trial & error, I can tell you the biggest time value you can have before things go out of whack (due to specifics of floats) is 15250w1d23h47m16s854ms775us807ns.
There is no scripting (and by extension, no API) command that can translate that into a number or other sort of a useful value.
My PHP API client includes a function that can parse it, but it does so "outside" of the API protocol... It's included in the library to provide extra ease of use (and then people tell me the library is heavy...). More specifically it parses times into PHP's DateInterval object (an analog to RouterOS' time type; in general, said function transforms strings into native PHP types), and from there you can use it in conjunction with PHP's DateTime to do some useful date and time calculations.
e.g.
<?php
use PEAR2\Net\RouterOS;
require_once 'PEAR2_Net_RouterOS-1.0.0b6.phar';
$now = new DateTimeImmutable();
$interval = RouterOS\Script::parseValue('3w6d15h29m11s');
$later = $now->add($interval);
echo $later->format(DateTime::W3C);
(see also an actual example with "uptime"
in the library's wiki)
If you're using an API client in another language, you'd need to have an analogous function implemented in that language.
Here's the relevant source if you're willing to re-implement it.