我不能相信这个表面上明显的问题找到答案时失败了多长时间。我如何将日期时间转换为C#中的日期
Date SomeRandomMadeUpDate = DateTime.Now.AddMonths(randomMonths).Date;
Cannot implicitly convert type 'System.DateTime' to 'System.Date' I can even call:
Date.Now
但调用.AddDays
它返回一个DateTime
。
同样,问题是:如何把一个C#DateTime
成C#Date
是的。好的工作,并且非常感谢。现在我知道更多! – thepaulpage 2009-12-29 16:50:47