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 Issue #501

Open
1 of 2 tasks
s5unty opened this issue Jan 28, 2025 · 1 comment
Open
1 of 2 tasks

Timezone Issue #501

s5unty opened this issue Jan 28, 2025 · 1 comment
Labels
can't reproduce The bug can't be reproduced by one or more maintainers

Comments

@s5unty
Copy link

s5unty commented Jan 28, 2025

Check if applicable

  • I have searched the existing issues (required)
  • I'm willing to help fix the problem and contribute a pull request

Describe the bug

The database stores absolute time in the GMT timezone, specifically in the file cmd/new.go:L45.
The list command outputs relative time, also using the GMT timezone, as implemented in helpers/date.go:L56.

Because of the difference between GMT and the local timezone, the relative time output by list is inaccurate.

Even changing elapsed.Time to elapsed.LocalTime does not seem to resolve the issue.
https://github.com/rvflash/elapsed/tree/v0.2.0

How to reproduce?

# timedatectl | head -2
               Local time: 二 2025-01-28 16:51:48 CST
           Universal time: 二 2025-01-28 08:51:48 UTC

# zk p
... (exit)

# zk list -f oneline -s created-
... (8 hours ago)

zk configuration

[alias]
p = "zk new --no-input --group p foo/$(cat /dev/urandom | tr -dc '0-9a-z' | head -c4 | tee /tmp/.zk | head -c1)"

[group.p]
path = ["foo"]
[group.p.note]
filename = "{{sh 'cat /tmp/.zk'}}"

Environment

zk 0.14.1
system: Linux 6.8.0-51-generic x86_64 GNU/Linux
@tjex
Copy link
Member

tjex commented Feb 8, 2025

What is the purpose of the alias and group settings?

They're just generating random alphanumeric filenames right? I copied them to my config, but get an error for every run as it cycles through the generated file name in /tmp/.zk:

zk: error: new note: foo/m: directory not found

In any case I tried a fresh project and made a note. It reports time as 'just now'.

@tjex tjex added the can't reproduce The bug can't be reproduced by one or more maintainers label Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can't reproduce The bug can't be reproduced by one or more maintainers
Projects
None yet
Development

No branches or pull requests

2 participants