Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Vim スクリプトでユーザー環境のタイムゾーン オフセットを取得したいのですが、それは移植可能でなければなりません (Unix/linux/MacOSX、Windows)。
たとえば、ユーザーが夏にパリにいる場合、タイムゾーン オフセットは現在 +2 (UTC+2) です。
移植性の問題により、外部プログラムや非ネイティブ スクリプト エンジン (Perl、Python、Ruby...) の使用は除外されます。
:echo strftime("%z")%zフォーマット指定子と同じくらいポータブルです。
:echo strftime("%z")
%z