开发者

Vim script: how to retrieve the timezone offset?

开发者 https://www.devze.com 2023-01-12 10:58 出处:网络
I would like to get the timezone offset of the user environment in a Vim script and that must be portable (Unix/linux/MacOSX, Windows).

I would like to get the timezone offset of the user environment in a Vim script and that must be portable (Unix/linux/MacOSX, Windows).

For example, if the user is in Paris in summer, 开发者_JAVA技巧its timezone offset is currently +2 (UTC+2).

Portability concerns exclude using external programs or non native scripting engines (Perl, Python, Ruby...).


:echo strftime("%z") is as portable as the %z format specifier is.

0

精彩评论

暂无评论...
验证码 换一张
取 消