Skip to content

Commit 28d41fd

Browse files
authored
Merge pull request #49 from levens/fix_long
Fix toTimestamp
2 parents 351f27e + ba0fea1 commit 28d41fd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pytimber/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from .pagestore import PageStore
1212

13-
__version__ = "2.3.3"
13+
__version__ = "2.3.4"
1414

1515
__cmmnbuild_deps__ = [
1616
"accsoft-cals-extr-client",

pytimber/pytimber.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
)
5555

5656

57+
if six.PY3:
58+
long = int
59+
60+
5761
class LoggingDB(object):
5862
try:
5963
_jpype=jpype
@@ -102,7 +106,7 @@ def toTimestamp(self, t):
102106
elif isinstance(t,Timestamp):
103107
return t
104108
else:
105-
ts = Timestamp.from_(jpype.java.util.Date(long(t*1000)).toInstant())
109+
ts = Timestamp(long(t*1000))
106110
sec = int(t)
107111
nanos = int((t-sec)*1e9)
108112
ts.setNanos(nanos)

0 commit comments

Comments
 (0)