Decrease the resolution of 'sessionend' according to the rounding error of date2num and num2date #463
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The precision of 'roundtrip' conversion of datetime [i.e: num2date(date2num(datetime)) ] is 10 microseconds.
Therefore to prevent bug when performing double conversion of dates,
the resolution needs to be in order of magnitude lower - i.e. 100 ms.
Example:
num2date(date2num(datetime(2021,3,12, 4,59,59,999990)))
will berounded and return
2021-03-12_05:00:00.000000
This is bad because the round error percolated up to the Hours. In some cases (e.g. timezone is involved) this error can go up to Days - and shift the date by one day.