Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
你碰巧有一个关于如何从今天减去明天或 2 天的示例代码?然后我会根据它的保留值将它乘以一个数字。我正在考虑如何经营一家酒店入住并通过询问客户何时退房来显示其价格,因此价格将在入住时准备好
这应该有助于:
var rate = 100.00; var totalDays = 2; var startDate = DateTime.Today.AddDays(-totalDays ); var total = totalDays * rate; Console.WriteLine("rate: {0} totalDays : {1} startDate: {2} total: {3}", rate, totalDays, startDate, total);