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

strftime() ignores in-session $TZ value #3264

Closed
ZyX-I opened this issue Aug 29, 2015 · 4 comments
Closed

strftime() ignores in-session $TZ value #3264

ZyX-I opened this issue Aug 29, 2015 · 4 comments
Labels
bug issues reporting wrong behavior environment user system environment (terminal, shell, tmux) localization l10n
Milestone

Comments

@ZyX-I
Copy link
Contributor

ZyX-I commented Aug 29, 2015

Consider the following script:

let $TZ='UTC'
echo strftime('%H', 0)

. In Vim this will yield 00. In NeoVim this yields 03 (TZ is unset when session starts, system timezone is Europe/Moscow). It would actually be better to have third (timezone) argument to strftime(), but current variant is not compatible in any case.

@ZyX-I ZyX-I added the bug issues reporting wrong behavior label Aug 29, 2015
@justinmk justinmk added this to the 0.1-first-public-release milestone Aug 29, 2015
@tarruda
Copy link
Member

tarruda commented Sep 30, 2015

I have taken a quick look at f_strftime and couldn't find why nvim has this behavior, but it has something to do with how it sets environment variables because strftime(3) clearly states that it uses the $TZ environment variable and both vim and nvim call that function. Closing in favor of #3265.

@tarruda tarruda closed this as completed Sep 30, 2015
@ZyX-I
Copy link
Contributor Author

ZyX-I commented Sep 30, 2015

@tarruda I do not see how is #3265 related?

@ZyX-I ZyX-I reopened this Dec 25, 2015
@justinmk justinmk modified the milestones: 0.2, 0.3 Oct 31, 2016
@clason clason modified the milestones: 0.6, 0.7 Nov 30, 2021
@justinmk justinmk modified the milestones: 0.9, unplanned Mar 8, 2023
@justinmk
Copy link
Member

justinmk commented Mar 8, 2023

Can't reproduce this on macos but maybe $TZ is not respected there (not mentioned in Man strftime(3)).

Can someone check this on linux?

@zeertzjq
Copy link
Member

zeertzjq commented Mar 9, 2023

Cannot reproduce on Linux either.

@zeertzjq zeertzjq added the environment user system environment (terminal, shell, tmux) label Mar 9, 2023
@justinmk justinmk closed this as completed Mar 9, 2023
@justinmk justinmk added the localization l10n label Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior environment user system environment (terminal, shell, tmux) localization l10n
Projects
None yet
Development

No branches or pull requests

5 participants