diff options
author | Patrick Helm <deradon87@gmail.com> | 2013-03-30 18:23:50 +0100 |
---|---|---|
committer | Patrick Helm <deradon87@gmail.com> | 2013-03-30 18:23:50 +0100 |
commit | cb320f41388a62e3d59e7e4cdb7ea0b6d26dae66 (patch) | |
tree | f7e1fbbfe858374ccaa24196a291f9b16d640e6e /app/helpers | |
parent | 81465cc3b4095791a8258cf76ce0fe8deb23ccbd (diff) | |
download | gitlab-ci-cb320f41388a62e3d59e7e4cdb7ea0b6d26dae66.tar.gz |
Fix Build#duration when TimeZone is not UTC
I got wrong Build#durations, cause ServerTime is not UTC.
Sample Output:
$: build.from
=> Sat, 30 Mar 2013 16:58:42 UTC +00:00
$: Time.now
=> 2013-03-30 18:20:25 +0100
$: Time.zone.now
=> Sat, 30 Mar 2013 17:20:29 UTC +00:00
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/builds_helper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/helpers/builds_helper.rb b/app/helpers/builds_helper.rb index c247d39..0f15f84 100644 --- a/app/helpers/builds_helper.rb +++ b/app/helpers/builds_helper.rb @@ -2,7 +2,7 @@ module BuildsHelper def build_duration build if build.started? from = build.started_at - to = build.finished_at || Time.now + to = build.finished_at || Time.zone.now distance_of_time_in_words(from, to) end end |