#1919 expect, that hub is returning GM time
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji issue1915  into  master

file modified
+2 -2
@@ -2,7 +2,7 @@ 

  #from kojiweb import util

  #from six.moves.urllib.parse import quote

  #import cgi

- #import time

+ #import datetime

  

  #def printValue($key, $value, $sep=', ')

    #if $key in ('brootid', 'buildroot_id')
@@ -343,7 +343,7 @@ 

      #set $end_ts = $task.completion_ts

      #end if

      #if not $end_ts

-     #set $end_ts = time.time()

+     #set $end_ts = datetime.datetime.utcnow().timestamp()

      #end if

      <tr>

        <th title="From task's creation">Total time</th>

Problem is, that timestamps are coming from DB. If DB's timezone is not set to GMT, we still can get weird times. @mikem Is it safe to assume, that it is in GMT? Should we emphasize it somewhere in installation docs?

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

2 years ago

Metadata Update from @jcupova:
- Pull-request tagged with: testing-done

2 years ago

Commit 64d78d3 fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago

This is not Python 2-safe. .timestamp() does not exist in Python 2 datetime. Will send a fix.

This is not Python 2-safe. .timestamp() does not exist in Python 2 datetime. Will send a fix.