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

"%Z" does not convert to local time zone name with Date Extension #1072

Closed
macintacos opened this issue Apr 15, 2022 · 3 comments
Closed

"%Z" does not convert to local time zone name with Date Extension #1072

macintacos opened this issue Apr 15, 2022 · 3 comments
Assignees
Labels
documentation Documentation related to this repo (for devs)

Comments

@macintacos
Copy link

Describe the bug

Take the following trigger:

global_vars:
  - name: todaysDate
    type: date
    params:
      format: "%B %e, %Y"

matches:
  - trigger: "xdut"
    replace: "{{todaysDate}} [{{24HourTime}}]"
    vars:
      - name: "24HourTime"
        type: date
        params:
          format: "%T %Z"

According to the documentation, I would expect that using the %Z specifier would print out the local time zone name:

CleanShot 2022-04-15 at 13 20 07@2x

But it doesn't. I get the same thing as the %z, which is the offset from the local time to UTC. Expanding the above right now, I get: April 15, 2022 [13:22:01 -04:00]

To Reproduce

Steps to reproduce the behavior:

  1. Create a trigger with the above
  2. Expand the trigger (in this case xdut) and observe

Expected behavior

The name of the local time zone would be printed out with the time, instead of the offset..

Setup information

  • OS: macOS 12.3.1
  • Version: 2.1.5-beta
@macintacos macintacos added the bug Something isn't working label Apr 15, 2022
@macintacos macintacos changed the title "%Z" does not convert to local time zone name "%Z" does not convert to local time zone name with Date Extension Apr 15, 2022
@Nezteb
Copy link

Nezteb commented Nov 5, 2023

I can replicate this.

With this format:

"%F   %T  %z  %Z"

This text is output:

2023-11-05   14:08:16  -0800  -08:00

@smeech
Copy link
Collaborator

smeech commented Feb 15, 2024

Thank you for bringing this to our attention. Sorry it has taken so long for someone to pick this up.
The chrono documentation was corrected regarding this issue in May 2023, after the data was copied, I presume, to make _date-format-specifiers.mdx.
We either need to update our documentation or just rely on a link to the source material (my preference).

@smeech smeech added documentation Documentation related to this repo (for devs) and removed bug Something isn't working labels Feb 15, 2024
@smeech smeech self-assigned this Feb 15, 2024
@smeech
Copy link
Collaborator

smeech commented Feb 15, 2024

I'll close this here as it's now referenced in espanso/website#38

@smeech smeech closed this as completed Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation related to this repo (for devs)
Projects
None yet
Development

No branches or pull requests

3 participants