Created
January 11, 2012 06:20
-
-
Save mattn/1593343 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s:reg_path = 'HKLM\System\CurrentControlSet\Control\TimeZoneInformation' | |
function! s:GetTimeZoneName() | |
let res = system(printf("reg query %s /v StandardName | findstr REG_SZ", s:reg_path)) | |
return split(substitute(res, '\n', '', 'g'), '\s')[2] | |
endfunction | |
function! s:GetTimeZoneOffset() | |
let res = system(printf("reg query %s /v Bias | findstr REG_DWORD", s:reg_path)) | |
return -(split(res, '[ \t\n]\+')[2] / 60) | |
endfunction | |
"echo s:GetTimeZoneName() | |
"echo s:GetTimeZoneOffset() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You Cool!!