converting DateTime to Date looses time zone information resulting in bad time computing

Specifically, for Tahiti, time zone is -10 so after 14h, UTC time is Tahiti time + 10h i.e the day after. Loosing time zone results in 1 day difference whether the time is computed before of after 14h :-)
This commit is contained in:
maatinito 2019-03-06 13:55:40 -10:00 committed by simon lehericey
parent 5605ceacc2
commit 766e9db752

View file

@ -204,7 +204,7 @@ class StatsController < ApplicationController
def max_date
if administration_signed_in?
Time.zone.now.to_date
Time.zone.now
else
Time.zone.now.beginning_of_month - 1.second
end