0

do you happen to have a sample code on how to subtract day tomorrow or 2 days from today? And then I will multiply it by a number depending on its reserved value. I am figuring how to operate a hotel checking in and show its price by asking when the customer checks out, so the price will be ready upon checking in

TFD
  • 23,890
  • 2
  • 34
  • 51
xyrus the virus
  • 219
  • 1
  • 3
  • 7

1 Answers1

2

This should help:

        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);
mhttk
  • 1,688
  • 1
  • 16
  • 29