Date.tomorrow referencing two days from now

后端 未结 2 965
盖世英雄少女心
盖世英雄少女心 2021-01-21 02:28

I\'m seeing something very odd.

<%= (Date.today).strftime(\"%A, %B %d, %Y\") %>

is resulting in Wednesday, Octobe

2条回答
  •  盖世英雄少女心
    2021-01-21 03:17

    Rails-Date has provided current method to compliment today method of Ruby-Date. So now you can use:

    Date.current     # Rails equivalent of Ruby's - Date.today
    Date.tomorrow
    

    for all dates which should be respecting Rails timezone and Ruby-Date.today keeps being what it is.

提交回复
热议问题