Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DATE values are returned in DATETIME format #1511

Open
gfinger opened this issue Mar 15, 2024 Discussed in #1510 · 0 comments
Open

DATE values are returned in DATETIME format #1511

gfinger opened this issue Mar 15, 2024 Discussed in #1510 · 0 comments

Comments

@gfinger
Copy link
Contributor

gfinger commented Mar 15, 2024

Discussed in #1510

Originally posted by gfinger March 15, 2024
I define a Vertex type person with the following sql-statements:

            "alter database dateformat \"dd MM yyyy GG\"",
            "alter database datetimeformat \"dd MM yyyy GG HH:mm:ss\"",
            "create vertex type Person if not exists",
            "create property Person.name if not exists String (mandatory true, notnull true)",
            "create index if not exists on Person (name) unique",
            "create property Person.dateOfBirth if not exists Date",
            "create property Person.dateOfDeath if not exists Date"

Then I create a Vertex of type Person using the http-api:

{"language":"sql","command":"insert into Person content {\"name\":\"Chlodwig\",\"dateOfBirth\":\"01 01 0001 BC\",\"dateOfDeath\":\"01 01 0001 AD\",\"@type\":\"Person\",\"@cat\":null,\"@rid\":null}","params":{},"serializer":"record"}

The response shows the newly created Person as

{"user":"root","version":"23.7.1 (build 3213507e324358b3d1af59654e8c3f02f9c894ad/1709289154602/23.7.1)","serverName":"ArcadeDB_0","result":[{"@rid":"#12:0","@type":"Person","@cat":"v","dateOfDeath":"01 01 0001 AD 00:00:00","name":"Chlodwig","dateOfBirth":"01 01 0001 BC 00:00:00"}]}

The date is formatted as datetime. Why is this?
The problem is that on the client side I store the dates as LocalDates, not as LocalDateTimes, so that the deserialization of the returned values failed. Can this somehow be changed, so that the format of the returned date doesn't use the datetime pattern?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant