Skip to content

Update time.py to solve the microsecond issues#1

Merged
ckdanny merged 1 commit into
masterfrom
relative-microsecond-bug
Nov 27, 2018
Merged

Update time.py to solve the microsecond issues#1
ckdanny merged 1 commit into
masterfrom
relative-microsecond-bug

Conversation

@ckdanny

@ckdanny ckdanny commented Nov 27, 2018

Copy link
Copy Markdown
Owner

When relative is set to True, the day, hour, minutes second will be round to the nearest one, however, the original program do not update the microsecond (reset it). As a result, the run-time offset on the microsecond will then be accumulated.
For example, given the interval is 15s and relative is set to True

  1. 2018-11-27T15:01:30.123236+08:00
  2. 2018-11-27T15:01:45.372687+08:00
  3. 2018-11-27T15:02:00.712601+08:00
  4. 2018-11-27T15:02:15.987720+08:00
  5. 2018-11-27T15:02:31.023670+08:00
    When relative is set to True, microsecond offset still accumulate celery/celery#5198

When `relative` is set to True, the day, hour, minutes second will be round to the nearest one, however, the original program do not update the microsecond (reset it). As a result, the run-time offset on the microsecond will then be accumulated. 
For example, given the interval is 15s and relative is set to True
1.    2018-11-27T15:01:30.123236+08:00
2.    2018-11-27T15:01:45.372687+08:00
3.    2018-11-27T15:02:00.712601+08:00
4.    2018-11-27T15:02:15.987720+08:00
5.    2018-11-27T15:02:31.023670+08:00
@ckdanny
ckdanny merged commit 55e1de5 into master Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant