andreachild commented on code in PR #3090:
URL: https://github.com/apache/tinkerpop/pull/3090#discussion_r2036265714


##########
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java:
##########
@@ -57,8 +57,16 @@ 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.Date(").append(dt.getYear()).
+                append(", ").append(dt.getMonthValue()).
+                append(", ").append(dt.getDayOfMonth()).
+                append(", ").append(dt.getHour()).
+                append(", ").append(dt.getMinute()).
+                append(", ").append(dt.getSecond()).
+                append(", ").append(dt.getNano()).
+                append(", time.FixedZone(\"UTC\", 
").append(dt.getOffset().getTotalSeconds()).append(")").

Review Comment:
   Looking at documentation https://pkg.go.dev/time#FixedZone it looks like the 
zone name should include the offset, ie. `UTC-8`.
   
   Also can a test be added to `GremlinTranslatorTest.java` for non zero offset 
scenario?



-- 
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]

Reply via email to