I have a project about borrowing bicycle app. This is my first project and i dont know how to show time and how to add 30minute in it
My algorithm is like this -the costumer borrow the bicycle -display time when the costumer borrow the bicycle -display time when the costumer have to return the bicycle(30 minute after borrowing) -the total price is 3USD for 30 minute(1USD per ten minute) -display the total price
So, how can i display the time he borrow the bicycle, time when he have to return it(30mnt) and thw total price
CodePudding user response:
To show time you can use DateTime wich is a struct so you don´t need to make an instance of it. to get the current time: DateTime.Now; to add 30 minutes to that time DateTime.AddMinutes(30); Hope this is helpful.