在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
DateTime d1 = hrStaff.DateJoin; DateTime d2 = DateTime.Now; TimeSpan d3 = d2.Subtract(d1); double d4 = (double)(d3.Days) / 365; //int interval = new TimeSpan(d2.Ticks - d1.Ticks).Days; 获取总共相差的天数 string str1 = d4.ToString("f1");//fN 保留N位,四舍五入 //decimal dec = decimal.Round((decimal)(d3.Days) / 365, 1); //同样能实现四舍五入保留一位小数 参考: http://blog.csdn.net/binzai325/article/details/6908112 http://www.cnblogs.com/sunney/archive/2010/07/28/1786903.html http://www.zzzj.com/html/20080926/66172.html http://www.cnblogs.com/sunney/archive/2010/07/28/1786903.html
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论