Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Understanding time of day functions
Message
De
20/12/2018 19:58:11
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
C#
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01664711
Message ID:
01664754
Vues:
32
>>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.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform