Rails BST timezone implementation

前端 未结 2 759
萌比男神i
萌比男神i 2021-01-15 13:47

Does anyone know how i can use BST for config.time_zone in my rails config/environment.rb file?

At the moment i have left it as UTC and i\'m thinking of adding BST t

相关标签:
2条回答
  • 2021-01-15 14:04
    rake time:zones:all
    

    You'll probably see a time zone named London, which is just UTC +00:00, but should handle UK daylight saving time properly.

    0 讨论(0)
  • 2021-01-15 14:13

    The TimeZone you need to set is UK, this will automatically handle BST

    Time.zone = 'London'
    Time.zone.now
     => Sun, 17 Oct 2010 02:09:54 BST +01:00
    
    0 讨论(0)
提交回复
热议问题