From b42036399e88899ec927b7d725caf18225d91c99 Mon Sep 17 00:00:00 2001 From: lovelyzhang Date: Tue, 27 Dec 2016 11:24:34 +0800 Subject: [PATCH] zy:modify time zone --- app/helpers/application_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7fed9aa..c58e6db 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2,7 +2,7 @@ module ApplicationHelper def get_strftime intime # 将数据库中的UTC时间转换为本地时间 - return intime.localtime.strftime(format='%F %T') + return intime.utc.in_time_zone('Beijing').strftime(format='%F %T') end end