I needed to make some empirical adjustments; added comments for discussion
I referenced this as a resource to handle the partial seconds for datepart in ['second', 'millisecond']. This didn't make enough of a difference to matter at coarser dateparts.
I looked into using julian days, also referenced in the article above, but they turned out to not be as effective as using epoch time for measuring single millisecond differences, since they ended up being orders of magnitude smaller than the smallest epoch time delta, which makes the empirical values have a smaller scale which doesn't make the comparison easier.
Overall I think it feels a bit hacky and I'd like to do more thorough testing against a full "solved" calendar table to see if the empirical factors need refinement, or if this implementation needs to be re-thought.
Overall I think it feels a bit hacky and I'd like to do more thorough testing against a full "solved" calendar table to see if the empirical factors need refinement, or if this implementation needs to be re-thought.