Cole-Greer commented on code in PR #3090:
URL: https://github.com/apache/tinkerpop/pull/3090#discussion_r2029373255
##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java:
##########
@@ -57,8 +58,8 @@ public GoTranslateVisitor(final String
graphTraversalSourceName) {
public Void visitDateLiteral(final GremlinParser.DateLiteralContext ctx) {
// child at 2 is the date argument to datetime() and comes enclosed in
quotes
final String dtString = ctx.getChild(2).getText();
- final Date dt =
DatetimeHelper.parse(removeFirstAndLastCharacters(dtString));
- sb.append("time.UnixMilli(" + dt.getTime() + ")");
+ final OffsetDateTime dt =
DatetimeHelper.parse(removeFirstAndLastCharacters(dtString));
+ sb.append("time.UnixMilli(" + dt.toInstant().toEpochMilli() + ")");
Review Comment:
We may be able to preserve more precision as well as the timezone offset via
https://pkg.go.dev/time#Date
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]