xiazcy commented on code in PR #3090:
URL: https://github.com/apache/tinkerpop/pull/3090#discussion_r2033636413
##########
gremlin-go/driver/graphBinary.go:
##########
@@ -1044,6 +1078,18 @@ func timeReader(data *[]byte, i *int) (interface{},
error) {
return time.UnixMilli(readLongSafe(data, i)), nil
}
+func offsetDateTimeReader(data *[]byte, i *int) (interface{}, error) {
+ year := readIntSafe(data, i)
+ month := readByteSafe(data, i)
+ day := readByteSafe(data, i)
+ ns := readLongSafe(data, i)
+ offset := readIntSafe(data, i)
+ // only way to pass offset info, timezone display is fixed to UTC as
consequence (offset is calculated properly)
+ loc := time.FixedZone("UTC", int(offset))
+ datetime := time.Date(int(year), time.Month(month), int(day), 0, 0, 0,
int(ns), loc)
Review Comment:
Unfortunately the Date constructor requires `int`, it's more like a caveat
of go, not sure if it's avoidable.
--
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]