If im not mistaken you can just use
$duration($abs($calc($ctime(date) - $ctime(date))))
$dateDiff:
alias -l durationFix {
if ($regex(datefix, $1, /^(\d+)wks? (.+)$/i)) {
var %mo, %wks
if ($iif($floor($calc($regml(datefix,1) / 4)), $v1,)) {
var %mo = $v1 $+ mo
var %wks = $iif($calc($v1 % 4), $v1 $+ wks,)
}
return %mo %wks $regml(datefix, 2)
}
return $1
}
alias dateDiff {
var %diff = $duration($abs($calc($ctime - $ctime($1))))
return $durationFix(%diff)
}
;usage:
$dateDiff(<date>)
Please note, I did NOT test it. I just went off memory so it could be a bit sketchy :/
thanks sreject, it does work. this is what i used to test your simplified version
BUT..... i would like it to display 1mo, rather then 4wks. if there is a way, im down to learn and ditch this long math problem in my remote section. i included another screenshot for you to see what the result of your snippet looked like side by side the php long conversion snippet.