Cool Snippet, and on Jethros pointer of making it one alias as the two would only use the first one
I did this:
age {
var %b Oct 11 1887 10:00:00
var %secs $calc($ctime - $ctime(%b $iif($regex(%b,\d\d:\d\d:\d\d),,00:00:00)))
var %years $calc(%secs /31556926)
var %nb $regsubex(%b,\d\d\d\d,$calc($date(yyyy) $iif($floor(%years) = $calc($date(yyyy) - $date($ctime(%b),yyyy)),+ 1,))) $iif($regex(%b,(\d\d:\d\d:\d\d)),,00:00:00)
$iif($1,me is ,say I am ) %secs seconds old which is %years years, in $duration($calc($ctime(%nb) - $ctime)) $me will be $calc($int(%years) +1) on %nb
}
Changed the set to var and used a $iff so say:
/age Returns
and
/age
<.iMaki> I am 659507256 seconds old which is 20.89897 years, in 5wks 1day 19hrs 32mins 24secs iMaki will be 21 on Nov 17 2011 10:00:00
Any who nice work.