AddTicks not work correctly
See original GitHub issueadd ticks not work correctly in this simple :
https://deck.net/d8843f388823586dca2a2b94bbbd6af1
Expected Result
2019-12-01T00:00:00.0000000
2019-11-30T23:59:59.9990000
2019-11-30T23:59:59.9990000
Actual Result
2019-12-01T00:00:00.0000000
2019-12-01T00:00:00.0000000
2019-11-30T23:59:59.9990000
i think to fix this problem its to replace:
https://github.com/theolivenbaum/h5/blob/d9c8a733e6b55584c3bd37b1f461ae9378882550/H5/H5/shared/System/DateTime.cs#L454
with is :
return new DateTime((ulong)(ticks + value));
or with this:
return new DateTime((long)(ticks + value));
Issue Analytics
- State:
- Created 2 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
c# - Unable to use DateTime.AddTicks
Timer.Interval is milliseconds. But ticks are not milliseconds, they are something much smaller. You're mixing apples and oranges. I think you ...
Read more >DateTime.AddTicks() Method in C# - GeeksforGeeks
This method is used to returns a new DateTime that adds the specified number of ticks to the value of this instance. This...
Read more >How to add ticks in a circle in TikZ
How to add ticks in a circle in TikZ ... But, this approach is not effective, as the ticks length has to calculated...
Read more >DateTime.AddTicks(Int64) Method (System)
Returns a new DateTime that adds the specified number of ticks to the value of this instance.
Read more >pgfplots, multiply values, add ticks without numbers
I need a tick for every beat, but not a number, because the numbers would overlap. I need to multiply the values of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@theolivenbaum I think you can use create$2 version inside AddTicks. Please use the following code (and I will not fork the repo for the moment).
I have adjusted it a bit for needs of AddTicks. And it shows more correct result.
Of course it is not 999 9999, but at least the behaviour is equal to other DateTime logic and bug is solved.
Looks good, I’ll add over the weekend when I’ve some time, thanks!