Skip to content

Commit

Permalink
Using dateutil to parse tc timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
jdewinne committed Apr 5, 2019
1 parent 32640e7 commit be0d280
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/teamcity/BuildConfigurationsStatusTile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#

import logging
import time

from dateutil.parser import parse
from teamcity import TeamCityClient

logger = logging.getLogger("TeamCity")
Expand Down Expand Up @@ -62,7 +62,7 @@
build_test_occurrences["failureCount"] = failureCount
project_status["statuses"].append({"name": build_configuration['name'], "status": build_configuration['builds']['build'][0]['status'],
"statusText": build_configuration['builds']['build'][0]['statusText'],
"finishDate": time.strftime("%a, %d %b %Y %H:%M:%S", time.strptime(build_configuration['builds']['build'][0]['finishDate'], "%Y%m%dT%H%M%S+0000")),
"finishDate": parse(build_configuration['builds']['build'][0]['finishDate']).strftime("%a, %d %b %Y %H:%M:%S"),
"problemOccurrences": build_problem_occurrences, "testOccurrences": build_test_occurrences,
"buildLog": processed_build_log,
"statusUrl": "%s/app/rest/builds/buildType:(id:%s)/statusIcon" % (teamcityServer["url"], build_configuration['id']),
Expand Down

0 comments on commit be0d280

Please sign in to comment.