Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Understanding time of day functions
Message
 
 
To
20/12/2018 19:58:11
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
C#
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01664711
Message ID:
01664755
Views:
40
>>>Good answer. I never thought that the word "day" would be in the time value :)
>>>Thank you.
>
>It is not a time value, it is a TimeSpan - read it as the Time Spanned (Time Passed if you wish).
>
>
>
>>
>>I know I gave my word that the previous would be the last question. But it is my word: I give it and then I take it back :)
>>
>>So, this is a truly the last question:
>>When I set the time to tsTime = new TimeSpan(24,0,0), I can safely rely that ANY real time of the day will be either less than this time, or equal to it (case of the midnight). Correct?
>
>You can add a TS value to any date, and yes any time in that day would be less than that. ie:
>
>
>var myDate = new DateTime(2018,1,1);
>
>var startOfNextDay = myDate + TimeSpan.FromHours(24);
>
>var anyTimeInMyDate = new DateTime(2018, 1, 1, HH, MM, SS, MS);
>
>
>
>anyTimeInMyDate is before startOfNextDay. IOW:
>
>anyTimeInMyDate.Date.AddDays(1) is equal to startOfNextDay.

I understand. Thank you!
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform