You may know this, but just in case... unless you have your alias on a timer, your record uptime isn't going to be kept updated. You should separate out the display and put the alias on a timer.
As for displaying months/years... those vary and it's not possible to really determine the time. What's a month? 28, 29, 30, or 31 days? What's a year? 365, or 366 days? Or 365.25 (rounded)?
If you simply said 4 weeks = 1 month, then you'll be assuming every month is 28 days, which would be inaccurate.
Now, you *could* make a workaround if you really wanted to get into coding a lot of checks. For current uptime, you can check the current month and figure out the amount of time using that information. For your record, you could just store the output as you want it to appear.
Example (that will only work for this one... I'm not going to write the entire thing out right now):
set %days $calc($iif($gettok(%uptime,1,119) isnum,$gettok(%uptime,1,119),0) * 7 + $iif($gettok($gettok(%uptime,1,100),2,119) isnum,$gettok($gettok(%uptime,1,119),2,119),0))
if (%days > 27 && %days < 59)
if ($date(mm) == 03) {
set %months 1
set %weeks $iif($calc((%days - 28) / 7) >= 1,$calc((%days - 28) / 7),0)
set %finaldays $calc(%days - 28 - (%weeks * 7))
echo -a %months %weeks %finaldays
}
Note that I didn't bother with the hours/mins/secs, but that's the same idea. I also set it up with the assumption that %uptime includes your $duration of the uptime value in the format of 20wks 3days 1hr 4mins 20secs.
You can make a $days alias that will automcatically determine months based on what month it is and the number of days and so on. You basically have to determine the which months you are looking at and how many days in each month and go from there. It's not a simple script if you want it to work properly, but it can be done... for this. As long as you KNOW the starting or editing date, you can do this. For uptime, you do know the ending date.
And, remember, you put the record uptime in there as you want it displayed... not as a value that would need calculated, because you won't have your date anymore to calculate it properly.
As a final note, I wouldn't really be using a if %days > __ && %days < __ in a final script to handle this... I used that just to point out how it would work for a single time frame (over 1 month and under 2 months when the current date is in March. Note also that I didn't take into account leap year in this example, but it could easily be checked for.
I may consider making a full $days_to_months_and_years alias ... we'll see. But, it's not a quick and easy thing to do.