Dgraph date.Time

Hello.
What correct type I can add to dgraph dateTime type?
When I use the official example, ran into the following problem

status = StatusCode.UNKNOWN
details = "parsing time “” as “2006-01-02T15:04:05”: cannot parse “” as “2006"”

schema:
public_date: datetime .
implementation_date: datetime .

item = {
‘public_date’: datetime.datetime(1980, 1, 1, 23, 0, 0).isoformat(),
‘implementation_date’: datetime.datetime(1981, 1, 1, 23, 0, 0).isoformat(),
}

Did I do something wrong?

Welcome @Soultrans. Datetime needs to be as per RFC3339 format which is not the same as ISO (ISO 8601) format. Please see this link.

Thanks.But how do I add Datetime format data to Dgraph? And I use Official Dgraph client implementation for Python.

Can you give me some examples? Think again!

Yes, I have read the documentation carefully

Hi @Soultrans, In this example published on the dgraph repo, the date time is created as below.
'dob': datetime.datetime(1980, 1, 1, 23, 0, 0, 0).isoformat().
Could you please give this a try (there is an extra 0).

Many thanks for you !

happy to help! have a great day.