Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezone/time on Windows seems to be off by one hour #32

Closed
guidoschmidt opened this issue Apr 22, 2024 · 1 comment · Fixed by #35
Closed

Timezone/time on Windows seems to be off by one hour #32

guidoschmidt opened this issue Apr 22, 2024 · 1 comment · Fixed by #35
Assignees
Milestone

Comments

@guidoschmidt
Copy link
Owner

guidoschmidt commented Apr 22, 2024

Describe the bug
Using circardian--encode-time on Windows seems to offset the time by 1 hour.

To Reproduce
Steps to reproduce the behavior:

  • Execute eval-expression and enter (decode-time (circadian--encode-time 11 54))
  • Result is one hour off, eg (0 54 12 22 4 2024 1 t 7200)

Expected behavior
Using (decode-time (circadian--encode-time 11 54)) should not offset time by one hour.

Environment (please complete the following information):

  • OS: Windows 11
  • Emacs: Emacs 29.3
@guidoschmidt guidoschmidt self-assigned this Apr 22, 2024
@guidoschmidt guidoschmidt modified the milestones: 0.4.0, 0.4.1, 0.5.0 Apr 22, 2024
@guidoschmidt
Copy link
Owner Author

Looks like passing the time zone via (current-time-zone) results in a wrong time zone on windows. According to (encode-time) documentation, you can just pass ignored -1 nil for the time zone settings.

@guidoschmidt guidoschmidt linked a pull request Apr 30, 2024 that will close this issue
guidoschmidt added a commit that referenced this issue Jun 3, 2024
* Create FUNDING.yml

* PERF/circadian.el: use memoized sunset & sunrise times (#29)

* Update issue templates

* EDIT: ignore :sunrise and :sunset, if calendar lat/lng settings are missing

* FIX: correct testing, filter :sunrise and :sunset if calendar lat/lng is not set

* FIX/test.el: re-enable test-circadian-setup-benchmark

* FIX/test.el: move timezone test to the end as it changes lat lng

* EDIT: check for theme lists to support #16

* FIX/test.el: typo

* FIX 28: emacs is freezed at switch (#31)

* EDIT/circadian.el: add print statement to circadian-activate-latest-theme

* FIX: potential fix for #28

* FIX/test.el: move timezone test to end

* EDIT/.github/workflows/ci.yml: drop Emacs 26.3 support

* EDIT/circadian.el: moved check for already enabled theme from `circadian-enable-theme` to `circadian-activate-latest-theme`

* EDIT: cleanup

* FIX: after merge

* FIX: remove print statements, make sure timer runs only once

* FIX: timer issue + rename circadian-activate-latest-theme to circadian-activate

* FIX/circadian.el: proper use of new `circadian-activate-and-schedule`

* FIX/test.el: adjust tests to use new API

* DOC/README.md: adjust usage section

* DOC/README.md

* FIX: use format-time-string

* FIX: improve timer scheduling

* FIX: wrong function in timer

* FIX: solve recursive timer calls with timer variable + cancel-timer

* FIX/DOC/README.md: proper inner list for random selection from theme list

* FIX: endless loop #33 + code cleanup, adjust tests

* EDIT: introduce circadian-verbose + circadian-stop

* FIX: cleanup, remove circadian-- prefix in favor of single dash prefix

* FIX: disable-theme only if requested theme is not part of custom-enabled-themes

* FIX: check if next run is today or tomorrow

* EDIT/test.el: extend test-circadian-time-comparisons

* FIX/circadian.el: ensure a single timer + timer is always set

* EDIT/README.md: hint about `circadian-verbose`

* FIX #32: proper time zone settings according to Emacs documentation

* EDIT/circadian.el: remove print statement

* FIX/test.el

* UPGRADE/.github: upgrade actions/checkout + actions/cache to version 4

* FIX/circadian.el: check for timer nil + enable theme -> set timer to nil

* FIX/circadian.el: proper canceling of previous timer

* EDIT/circadian.el: update version in comment

---------

Co-authored-by: StrawberryTea <luneth1314@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant