Click here to Skip to main content
15,918,516 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have two datetimepicker, i want subtract and find the time period.
Example:
datetimepicker1 08:56:18
datetimepicker2 09:12:20

result in this format

Reply me as soon as possible.
Thank You
Posted

Try:
C#
Timespan diff = datetimepicker2.Value - datetimepicker1.Value;
Look at theTimespan structure[^] to see what you can do with the result.

[edit] Tablets. Never code on Tablets...[/edit]
 
Share this answer
 
v2
Can use Timespan as below:

C#
Timespan diff = datetimepicker2.Subtract(datetimepicker1);


Hope it helps :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900