alias datediff {
[color:red] [/color]
/*
[color:red] [/color]
Usage: $datediff(begindate,targetdate).property
[color:red] [/color]
Properties:
[color:red] [/color]
"yyyy" Year
"q" Quarter
"m" Month
"y" Day of year
"d" Day
"w" Weekday
"ww" Week of year
"h" Hour
"n" Minute
"s" Second
[color:red] [/color]
Example: //echo -a $datediff(18/03/1982 08:30,3/05/2005 15:10).s
[color:red] [/color]
*/
[color:red] [/color]
if !$ctime($1) || !$ctime($2) || !$istok(yyyy q m d w ww h n s,$prop,32) { return }
var %a = a $+ $ticks, %b = Datediff( $+(",$prop,") ," $1"," $2")
.comopen %a msscriptcontrol.scriptcontrol
if $comerr { return }
tokenize 32 $com(%a,language,4,bstr,vbscript) $com(%a,eval,3,bstr,%b) $com(%a).result
.comclose %a
return $3
}