aholmberg commented on a change in pull request #1165: TINKERPOP-2264 Fixed
g:Date serialization for python.
URL: https://github.com/apache/tinkerpop/pull/1165#discussion_r306424056
##########
File path:
gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV3d0.py
##########
@@ -348,27 +348,26 @@ class DateIO(_GraphSONTypeIO):
python_type = datetime.datetime
graphson_type = "g:Date"
graphson_base_type = "Date"
+ epoch = datetime.datetime(1970, 1, 1)
@classmethod
def dictify(cls, obj, writer):
+ # Java timestamp expects milliseconds.
if six.PY3:
- pts = obj.timestamp()
+ pts = (obj - cls.epoch) / datetime.timedelta(seconds=1)
Review comment:
Same comments as V2d0 file.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services