The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
Hi, I've been using the code on the post on that same SO thread you mention that makes use of TimeSpan.TicksPerSecond and other TimeSpan values to truncate to several different values:[^]
«... thank the gods that they have made you superior to those events which they have not placed within your own control, rendered you accountable for that only which is within you own control For what, then, have they made you responsible? For that which is alone in your own power—a right use of things as they appear.» Discourses of Epictetus Book I:12
"I controlled my laughter and simple said "No,I am very busy,so I can't write any code for you". The moment they heard this all the smiling face turned into a sad looking face and one of them farted. So I had to leave the place as soon as possible." - Mr.Prakash One Fine Saturday. 24/04/2004
I would assume this is a simple rounding problem. But not where you expect it but in the internals of DateTime. Historically, DateTime is a double and not a "long long". Dates and times are converted to and from that double. One day is 1, half a day 0.5 and so on. And as it goes with the digits after the decimal point you can not represent any small fractions with a limited number length. Imagine a day has about 10e5 seconds or 10e8 ms. Adding the day (I don't remember when the counting starts) with 5 digits you are using 13 out of 15 digits. A millisecond is 1,157407407407e-8 days.
For testing you can write a routine which start at "Now" and adds millisecond after millisecond. Be surprised what you get when you expect a steady increasing value.
I don't, but perhaps you should hold your end of the bargain and not go sleep when downloading updates.
An update that should've been done in an hour took all morning and a good chunk of my Saturday afternoon. Because it's freakin' Saturday, and I want need to walk away, so the computer repeatedly goes to sleep.
And people wonder why I configure my systems so they never go to sleep...except for this one. But it's about to join that club.