Skip to content

Commit be00692

Browse files
Vitaliy RodnenkoVitaliy Rodnenko
authored andcommitted
fix crash when timestamp is 13 digits on python2.7 vitalyrodnenko#260
2 parents cf5baa0 + 790d264 commit be00692

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

geeknote/out.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,16 @@ def rawInput(message, isPass=False):
274274

275275

276276
def printDate(timestamp):
277+
278+
# Author @ash-2000 https://github.com/ash-2000
279+
# Check for crashing when timestamp is 13 digits on python2.7
280+
# pull request #260
281+
282+
if len(str(timestamp)) == 13:
283+
timestamp = int(str(timestamp)[0:-3])
284+
285+
# ---
286+
277287
return datetime.date.strftime(datetime.date.fromtimestamp(timestamp / 1000), "%d.%m.%Y")
278288

279289
def printLine(line, endLine="\n", out=sys.stdout):

0 commit comments

Comments
 (0)