Click here to Skip to main content
15,897,187 members
Home / Discussions / C#
   

C#

 
GeneralRe: TimeSpan Error?? Pin
Pete O'Hanlon17-Aug-15 5:15
mvePete O'Hanlon17-Aug-15 5:15 
GeneralRe: TimeSpan Error?? Pin
Kevin Marois17-Aug-15 5:24
professionalKevin Marois17-Aug-15 5:24 
GeneralRe: TimeSpan Error?? Pin
Dr. John L. Aven31-Aug-15 17:16
Dr. John L. Aven31-Aug-15 17:16 
GeneralRe: TimeSpan Error?? Pin
Ravi Bhavnani17-Aug-15 5:24
professionalRavi Bhavnani17-Aug-15 5:24 
GeneralRe: TimeSpan Error?? Pin
Kevin Marois17-Aug-15 5:25
professionalKevin Marois17-Aug-15 5:25 
GeneralRe: TimeSpan Error?? Pin
Ravi Bhavnani17-Aug-15 5:35
professionalRavi Bhavnani17-Aug-15 5:35 
GeneralRe: TimeSpan Error?? Pin
Matt T Heffron17-Aug-15 6:55
professionalMatt T Heffron17-Aug-15 6:55 
GeneralRe: TimeSpan Error?? Pin
Richard Deeming17-Aug-15 7:10
mveRichard Deeming17-Aug-15 7:10 
Consider a simpler example:
C#
TimelineStart = new DateTime(2015, 08, 11, 10, 00, 00);
TimelineEnd   = new DateTime(2015, 08, 11, 11, 00, 00);

TotalHours = (TimelineEnd - TimelineStart).TotalHours;

Subtracting two DateTime instances gives you a TimeSpan representing the difference between the two points on the timeline - ie: how many hours are there between 10:00 and 11:00 on 11th August 2015.

With your approach to the problem, TotalHours would contain 21. Unless you live next to a black hole, there aren't 21 hours between 10:00 and 11:00 on the same day. Laugh | :laugh:



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


QuestionWhy don't I see a VSTO template Pin
Gary Huck14-Aug-15 9:47
Gary Huck14-Aug-15 9:47 
AnswerRe: Why don't I see a VSTO template Pin
Richard MacCutchan14-Aug-15 20:49
mveRichard MacCutchan14-Aug-15 20:49 
Question(Solved) How to send a message from a rich text box control to a form Pin
Leif Simon Goodwin14-Aug-15 0:56
Leif Simon Goodwin14-Aug-15 0:56 
AnswerRe: How to send a message from a rich text box control to a form Pin
Arthur V. Ratz14-Aug-15 2:08
professionalArthur V. Ratz14-Aug-15 2:08 
SuggestionRe: How to send a message from a rich text box control to a form Pin
Richard Deeming14-Aug-15 3:18
mveRichard Deeming14-Aug-15 3:18 
GeneralRe: How to send a message from a rich text box control to a form Pin
Leif Simon Goodwin14-Aug-15 3:27
Leif Simon Goodwin14-Aug-15 3:27 
GeneralRe: How to send a message from a rich text box control to a form Pin
Arthur V. Ratz14-Aug-15 3:36
professionalArthur V. Ratz14-Aug-15 3:36 
GeneralRe: How to send a message from a rich text box control to a form Pin
Arthur V. Ratz14-Aug-15 3:30
professionalArthur V. Ratz14-Aug-15 3:30 
GeneralRe: How to send a message from a rich text box control to a form Pin
Leif Simon Goodwin14-Aug-15 3:43
Leif Simon Goodwin14-Aug-15 3:43 
GeneralRe: How to send a message from a rich text box control to a form Pin
Arthur V. Ratz14-Aug-15 3:59
professionalArthur V. Ratz14-Aug-15 3:59 
GeneralRe: How to send a message from a rich text box control to a form Pin
Arthur V. Ratz14-Aug-15 6:30
professionalArthur V. Ratz14-Aug-15 6:30 
GeneralRe: How to send a message from a rich text box control to a form Pin
Member 1144608014-Aug-15 18:24
Member 1144608014-Aug-15 18:24 
QuestionRuntime Form Designer Pin
Member 1144608014-Aug-15 0:00
Member 1144608014-Aug-15 0:00 
QuestionGo to Next Items of List box using timer in C# Pin
Member 1190306213-Aug-15 20:55
Member 1190306213-Aug-15 20:55 
AnswerRe: Go to Next Items of List box using timer in C# Pin
Wendelius13-Aug-15 21:01
mentorWendelius13-Aug-15 21:01 
AnswerRe: Go to Next Items of List box using timer in C# Pin
OriginalGriff13-Aug-15 22:04
mveOriginalGriff13-Aug-15 22:04 
GeneralRe: Go to Next Items of List box using timer in C# Pin
Member 1190306214-Aug-15 0:04
Member 1190306214-Aug-15 0:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.