@@ -75,11 +75,7 module ApplicationHelper | |||
|
75 | 75 | return nil unless time |
|
76 | 76 | time = time.to_time if time.is_a?(String) |
|
77 | 77 | zone = User.current.time_zone |
|
78 | if time.utc? | |
|
79 | local = zone ? zone.adjust(time) : time.getlocal | |
|
80 | else | |
|
81 | local = zone ? zone.adjust(time.getutc) : time | |
|
82 | end | |
|
78 | local = zone ? time.in_time_zone(zone) : (time.utc? ? time.utc_to_local : time) | |
|
83 | 79 | @date_format ||= (Setting.date_format.blank? || Setting.date_format.size < 2 ? l(:general_fmt_date) : Setting.date_format) |
|
84 | 80 | @time_format ||= (Setting.time_format.blank? ? l(:general_fmt_time) : Setting.time_format) |
|
85 | 81 | include_date ? local.strftime("#{@date_format} #{@time_format}") : local.strftime(@time_format) |
General Comments 0
You need to be logged in to leave comments.
Login now