开发者

Vim script: how to retrieve the timezone offset?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜