I want to round a DateTime to the nearest 5 seconds. This is the way I\'m currently doing it but I was wondering if there was a better or more concise way?
Technically, you can never correctly round to an odd interval given only seconds.
2, 4, 6, 8, 10 <-- are no problem
If you are 'distributing' times in intervals and if the jitter is low, truncation is a lot more tractable.
If you can pass milliseconds and round at a 500mS mark, you will be able to to odd seconds and also slash the effect of jitter way down or eliminate it entirely.