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

DateTime.from_unix_time() returns 1 hour earlier in the summer season #740

Open
ujihisa opened this issue May 4, 2020 · 0 comments
Open
Assignees

Comments

@ujihisa
Copy link
Member

ujihisa commented May 4, 2020

Vital:

function! s:f() abort
  let s:D = vital#vital#new().import('DateTime')
  echo s:D.from_unix_time(1325441045, 9).hour()
endfunction

call s:f()
"=> 2
" ↑ I expect 3

Ruby:

p Time.at(1325441045, in: '+09:00').hour
#=> 3

How to reproduce

Set TZ to a timezone that has DST, and during the summer season of the timezone just run the above Vim script or run DateTime spec. (e.g. TZ=America/Vancouver on 2020-05-04)

Travis can do that easily: https://github.com/vim-jp/vital.vim/pull/739/files#diff-354f30a63fb0907d4ad57269548329e3R64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants