In Rails, what's the nicest way to create a specific time (not now) in a particular time zone?

后端 未结 5 723
庸人自扰
庸人自扰 2021-02-01 01:36

Here\'s one way, but it\'s can you think of a nicer or more \'railsy\' method?

>> Time.use_zone(\'Sydney\'){ Time.zone.parse(\'2011-04-12 2pm\') }
=> T         


        
5条回答
提交回复
热议问题