DateTime support in orientdb

530 views
Skip to first unread message

GoorMoon

unread,
Dec 18, 2014, 4:05:47 PM12/18/14
to
Hello everyone,

I check the driver fault in OrientDB-Net.binary with dates and I noticed that the dates in between 1582-10-04 and 1582-10-15 can not be inserted into the database.
I understand that this happens because the Gregorian calendar that JAVA using. 
But I think the database must support all range of a dates at least from 0001-01-01 to 9999-12-31.
WDYT?

============================================

orientdb {db=Temp}> info class testvertex

Class................: TestVertex
Default cluster......: testvertex (id=12)
Supported cluster ids: [12]
Cluster selection....: round-robin

PROPERTIES
-------------------------------+---------------------+----------------------------------------------+----------------------+-------------------+----------------+-------------+--------------+----------------+
 NAME                     | TYPE             | LINKED TYPE/CLASS             | MANDATORY | READONLY | NOT NULL |    MIN    |    MAX    | COLLATE  |
-------------------------------+---------------------+----------------------------------------------+----------------------+-------------------+----------------+-------------+--------------+----------------+
 _dt                          | DATETIME     | null                                         | false               | false            | false          |              |               | default       |
-------------------------------+---------------------+----------------------------------------------+----------------------+-------------------+----------------+-------------+--------------+----------------+

orientdb {db=Temp}> select from testvertex

----+---------+----------------+------------------------------
#   |@RID |@CLASS    |_dt
----+---------+----------------+------------------------------
0   |#12:0  |TestVertex  |0001-01-01 00:00:00
----+---------+----------------+------------------------------

1 item(s) found. Query executed in 0.003 sec(s).
orientdb {db=Temp}> insert into TestVertex set _dt='1582-10-14 00:00:00'

Error: com.orientechnologies.orient.core.exception.OQueryParsingException: Error on conversion of date '1582-10-14 00:00:00' using the format: yyyy-MM-dd HH:mm:ss

orientdb {db=Temp}>

Charles Pick

unread,
Dec 19, 2014, 5:09:32 AM12/19/14
to orient-...@googlegroups.com
Could not replicate this with Oriento, see this test case - https://github.com/codemix/oriento/blob/gregorian-dates/test/bugs/xxx-gregorian-dates.js

Charles

GoorMoon

unread,
Dec 19, 2014, 8:20:59 AM12/19/14
to orient-...@googlegroups.com
I look in to your test case you didn't create properties with types.
Look in this scenario

CREATE CLASS TestClass
CREATE PROPERTY TestCLass.someDate date
CREATE PROPERTY TestCLass.someDateTime datetime

INSERT INTO TestClass SET someDate = "1582-10-04 09:00:00", someDateTime = "1582-10-14 09:00:00"

Charles Pick

unread,
Dec 19, 2014, 10:06:39 AM12/19/14
to orient-...@googlegroups.com
The properties do get created with types, but I can replicate the issue via the REST api, just not via binary. Try sending in the format "1582-10-04T00:00:00.000Z" and see if that makes a difference?

Charles

Charles Pick

unread,
Dec 19, 2014, 11:00:21 AM12/19/14
to orient-...@googlegroups.com
This is related to the query parser in some way - when using bound parameters it works perfectly,


Charles
Reply all
Reply to author
Forward
0 new messages