Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/time_zone_helper.rb')
-rw-r--r--app/helpers/time_zone_helper.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/helpers/time_zone_helper.rb b/app/helpers/time_zone_helper.rb
index fe045182c96..f92e32ff9b6 100644
--- a/app/helpers/time_zone_helper.rb
+++ b/app/helpers/time_zone_helper.rb
@@ -31,4 +31,9 @@ module TimeZoneHelper
}.slice(*attrs)
end
end
+
+ def local_time(timezone)
+ time_zone_instance = ActiveSupport::TimeZone.new(timezone) || Time.zone
+ time_zone_instance.now.strftime("%-l:%M %p")
+ end
end