if (oldDate != \"\") {
string strIssueDate = oldDate; //\"2012-09-12\";
string strMaturityDate = DateTime.Now.ToShortDateString().Trim(); //\"2012-09-18\"; if (strIssueDate != \"\" && strMaturityDate != \"\") {
string[] strStartDate = new string[] { \"\" }; string[] strEndDate = new string[] { \"\" }; //将?日¨?期¨²分¤?割?成¨¦数ºy组Á¨¦
int placeIssueDate = strIssueDate.IndexOf(\"-\", 0, strIssueDate.Length); //判D断?日¨?期¨²中D是º?否¤?有®D'-'号?
int placeMaturityDate = strMaturityDate.IndexOf(\"-\", 0, strMaturityDate.Length); //判D断?日¨?期¨²中D是º?否¤?有®D'-'号?
if (placeIssueDate == 0) {
strStartDate = new string[] { strIssueDate.Substring(0, 4), strIssueDate.Substring(4, 2), strIssueDate.Substring(6, 2) };
} else {
strStartDate = strIssueDate.Split('-'); }
if (placeMaturityDate == 0) {
strEndDate = new string[] { strMaturityDate.Substring(0, 4), strMaturityDate.Substring(4, 2), strMaturityDate.Substring(6, 2) }; } else {
strEndDate = strMaturityDate.Split('-'); }
TimeSpan tsIssueDays = new TimeSpan(); //实º¦Ì例¤y化¡¥一°?个?TimeSpan //把ã?分¤?隔?成¨¦数ºy组Á¨¦的Ì?日¨?期¨²传ä?进?DateTime中D,ê?组Á¨¦成¨¦的Ì?日¨?期¨²格?式º?如¨?:êo1/2/2001
DateTime dtIssueDate = new DateTime(int.Parse(strStartDate[0]), int.Parse(strStartDate[1]), int.Parse(strStartDate[2]));
DateTime dtMaturityDate = new DateTime(int.Parse(strEndDate[0]), int.Parse(strEndDate[1]), int.Parse(strEndDate[2]));
tsIssueDays = dtMaturityDate - dtIssueDa
因篇幅问题不能全部显示,请点此查看更多更全内容
Copyright © 2019- dfix.cn 版权所有 湘ICP备2024080961号-1
违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com
本站由北京市万商天勤律师事务所王兴未律师提供法律服务