Click here to Skip to main content
15,880,854 members
Home / Discussions / C#
   

C#

 
GeneralRe: TimeSpan Error?? Pin
Ravi Bhavnani17-Aug-15 5:12
professionalRavi Bhavnani17-Aug-15 5:12 
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 
The TimeSpan isn't counting forward or backward from any specific time.
It is representing (in this case) the elapsed time from one DateTime to another.
It has no concept of forward from "10 am".
If you used an hourglass to count time from 10 am Aug 11 until 8pm Aug 14, you would just be turning the glass over for the 82nd time at the 8pm Aug 14. The TimeSpan is just representing the amount of sand that flowed through neck of the hourglass (with much more precision than counting each grain of sand!!)
It is a signed difference.
If you did the subtraction in the other order it would return -82 hours.
It is just a counter.

[Edit]
C#
var TimelineStart = new DateTime(2015, 08, 11, 10, 00, 00);
var TimelineEnd = new DateTime(2015, 08, 14, 20, 00, 00);
TimeSpan delta = TimelineEnd - TimelineStart;
Debug.WriteLine(TimelineEnd.Ticks);
Debug.WriteLine(TimelineStart.Ticks);
Debug.WriteLine(delta.Ticks);
gives the output:
635751792000000000
635748840000000000
2952000000000

The DateTime items are counters forward from a reference date and time.
The TimeSpan is just representing the difference.
"Fairy tales do not tell children the dragons exist. Children already know that dragons exist. Fairy tales tell children the dragons can be killed."
- G.K. Chesterton


modified 17-Aug-15 13:20pm.

GeneralRe: TimeSpan Error?? Pin
Richard Deeming17-Aug-15 7:10
mveRichard Deeming17-Aug-15 7:10 
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 

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.