函数:
global type f_getdaysorhours from function_object
end type
forward prototypes
global function string f_getdaysorhours (datetime argstopdatetime)
end prototypes
global function string f_getdaysorhours (datetime argstopdatetime);string ls_daysorhours
long ll_days,ll_hours
ll_days = daysafter(date(today()),date(argstopdatetime))
if ll_days > 0 then
ls_daysorhours = "还剩:" + string(ll_days) + "天"
elseif ll_days = 0 then
ll_hours = hour(time(argstopdatetime)) - hour(now())
if ll_hours > 0 then
ls_daysorhours = "还剩:" + string(ll_hours) + "小时"
else
ls_daysorhours = "没有可用时间!!"
end if
else
ls_daysorhours = "没有可用时间!!"
end if
return ls_daysorhours
end function