Does .NET have a constant for the number of seconds in a day (86400)?
Number of seconds in a regular day is 86400. But the days when DST changes happen may be shorter or longer. However, writing 24*60*60 is not a bad practice at all, and it is most likely to be in-lined by the compiler, too!
It isn't a constant, the number of seconds in a day varies depending on the day and the timezone. Thus it isn't something that Microsoft is likely to offer. Show activity on this post. Thanks for contributing an answer to Stack Overflow!
Use caution when you refer to constant values defined in other code such as DLLs. If a new version of the DLL defines a new value for the constant, your program will still hold the old literal value until it is recompiled against the new version. Multiple constants of the same type can be declared at the same time, for example:
Multiple constants of the same type can be declared at the same time, for example: class Calendar2 { public const int Months = 12, Weeks = 52, Days = 365; }. The expression that is used to initialize a constant can refer to another constant if it does not create a circular reference.
It's not a constant value
http://en.wikipedia.org/wiki/Leap_second
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With