0
我需要以毫秒为单位的时间自1970年以来为今天与BST(英国夏令时间)偏移红宝石时区毫秒,自纪元在午夜
a = DateTime.now
=> Fri, 29 Sep 2017 16:30:29 +0100
b = DateTime.new(a.year, a.month, a.day, 0, 0, 0, 0)
=> Fri, 29 Sep 2017 00:00:00 +0000 # this is an hour out
b.strftime('%Q').to_i
1506643200000 # therefore this is an hour out
如何纠正呢?
b = b.in_time_zone
=> Fri, 29 Sep 2017 01:00:00 BST +01:00 # looks promising but...
b.strftime('%Q').to_i
=> 0 # grrr
任何最受欢迎的帮助