var o入職年 = o入職日期.Value.Year;
var o入職月 = o入職日期.Value.Month;
var o入職天 = o入職日期.Value.Day;
int y = DateTime.Now.Year - o入職日期.Value.Year; //年差
int m = y * 12 + DateTime.Now.Month - o入職日期.Value.Month; //月差
if (DateTime.Now.Day - o入職天 < 0)
{
m = m - 1;
}
int o工做年限 = m / 12;
return o工做年限;im