From 1e6b8a482ae12d48fa72305d73891a2611db47c5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 5 Jul 2008 07:39:07 +0000 Subject: [PATCH] Removes calls to TimeZone#adjust (#1584). git-svn-id: http://redmine.rubyforge.org/svn/trunk@1626 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 090d7b058..fdc541645 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -75,11 +75,7 @@ module ApplicationHelper return nil unless time time = time.to_time if time.is_a?(String) zone = User.current.time_zone - if time.utc? - local = zone ? zone.adjust(time) : time.getlocal - else - local = zone ? zone.adjust(time.getutc) : time - end + local = zone ? time.in_time_zone(zone) : (time.utc? ? time.utc_to_local : time) @date_format ||= (Setting.date_format.blank? || Setting.date_format.size < 2 ? l(:general_fmt_date) : Setting.date_format) @time_format ||= (Setting.time_format.blank? ? l(:general_fmt_time) : Setting.time_format) include_date ? local.strftime("#{@date_format} #{@time_format}") : local.strftime(@time_format) -- 2.39.5