From 675361e5d95d9245f52d381805990acc7cf5392c Mon Sep 17 00:00:00 2001 From: Matias Korhonen Date: Thu, 23 Oct 2014 13:15:14 +0300 Subject: [PATCH] Makes UTC optional --- lib/capistrano/deploytags.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/capistrano/deploytags.rb b/lib/capistrano/deploytags.rb index f9530eb..1fbcef2 100644 --- a/lib/capistrano/deploytags.rb +++ b/lib/capistrano/deploytags.rb @@ -11,7 +11,13 @@ module CapistranoDeploytags end def self.formatted_time - Time.new.utc.strftime(fetch(:deploytag_time_format, "%Y.%m.%d-%H%M%S-utc")) + now = if fetch(:deploytag_utc, true) + Time.now.utc + else + Time.now + end + + now.strftime(fetch(:deploytag_time_format, "%Y.%m.%d-%H%M%S-#{now.zone.downcase}")) end def self.commit_message(current_sha, stage)