Skip to content

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

Open
@ujihisa

Description

@ujihisa

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions