Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • F firmware
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Graph
    • Compare revisions
  • Issues 74
    • Issues 74
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 29
    • Merge requests 29
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • External wiki
    • External wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • card10card10
  • firmware
  • Merge requests
  • !184
The source project of this merge request has been removed.

fix(utime.c): make set_time correctly subtract TZONE_OFFSET

Merged Ferdinand Bachmann requested to merge (removed):master into master Aug 22, 2019
  • Overview 2
  • Pipelines 0
  • Changes 1

there were two bugs in set_time:

  • TZONE_OFFSET is not multiplied by 1000, even though epic_rtc_set_milliseconds was used.
  • TZONE_OFFSET is added in both time and set_time. set_time should subtract the timezone offset.

Testcase:

import utime

old = utime.time()
utime.set_time(old)
new = utime.time()

if old != new:
  print("time difference:", new - old)
  # will print 7607, or 2.11 hours with the old code
  # should print 0 or 1 at most
Edited Aug 22, 2019 by Ferdinand Bachmann
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: master