Specify time zone

What I want to do

Because the query result of Datetime type data is inconsistent with the written result, can we set a different time zone for dgraph?

Dgraph metadata

dgraph version
Dgraph version   : v20.11.2
Dgraph codename  : tchalla-2
Commit timestamp : 2021-02-23 13:07:17 +0530
Branch           : HEAD
Go version       : go1.15.5
jemalloc enabled : true

Not sure what is the issue here.

Yes. We use this standard RFC 3339 - Date and Time on the Internet: Timestamps

e.g: 1996-12-19T16:39:57-08:00 is PST timezone. UTC−08:00 - Wikipedia

The Datetime field I set to enter is different from the time I queried using the java client.

How to set dgraph to a time zone other than UTC?

As far as I know rfc3339 supports only UTC.

So, your issue is related to Dgraph’s client?

You can set your timezone in java on your date time object:

1 Like

Yes, I want to get the same time as the write time through the java client.

It is indeed a method, but the time I found on the retal may be different, but it is mainly based on the results found by the client. Thank you for your reminder.