views:

40

answers:

1

Hi experts, 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

+1  A: 

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
I will try this man. thanks for the reply.
xyrus the virus