String怎么转Date,在转String


如: 20130301 减去 1 怎么得到20130228
如果你确定锋销是yyyyMMdd这个格式的!就这么写!
var dt = DateTime.ParseExact("20130301", "yyyyMMdd"袜梁, null);
dt.AddDays(-1);
string result = dt.ToString("yyyyMMdd"银好游);
DateTime a = Convert.ToDateTime(Regex.Replace("20130301", @"档圆^(\d{4})(\d{2})(\并蠢滑d{2})$"绝腊, "$1-$2-$3", RegexOptions.IgnoreCase));

DateTime b = a.AddDays(-1);
DateTime date = new DateTime();
date = Convert.ToDateTime("毁颤带和2013-03-01"纤行败);

string str =date.ToShortDateString();