Skip to content

Commit 72f2f6b

Browse files
GarrStauhdost
authored andcommitted
Fix worklog timezone handling (#720)
* Fix worklog timezone handling * Update cspell.json
1 parent 28b3835 commit 72f2f6b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
"trw",
140140
"twz",
141141
"txcwsb",
142+
"tzinfo",
142143
"ucfirst",
143144
"ul",
144145
"uname",

jira/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1918,7 +1918,10 @@ def add_worklog(self,
19181918

19191919
if started is not None:
19201920
# based on REST Browser it needs: "2014-06-03T08:21:01.273+0000"
1921-
data['started'] = started.strftime("%Y-%m-%dT%H:%M:%S.000+0000%z")
1921+
if started.tzinfo is None:
1922+
data['started'] = started.strftime("%Y-%m-%dT%H:%M:%S.000+0000")
1923+
else:
1924+
data['started'] = started.strftime("%Y-%m-%dT%H:%M:%S.000%z")
19221925
if user is not None:
19231926
data['author'] = {"name": user,
19241927
'self': self.JIRA_BASE_URL + '/rest/api/latest/user?username=' + user,

0 commit comments

Comments
 (0)