How to store and compare Date up to sec.


How to store and compare date up to sec? By default it stores the dates like "23 May, 2020 10:25:23:112 AM" means date and timestamp including milisec but  I want to store till sec("23 May, 2020 10:25:23 AM") like MySql and other db. They stores the date up to sec.


ObjectDB stores date values with all their component, as they are in memory.

You can reset date part as you like, before the object is stored in the database. e.g.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)


Thank you for the response.I have implemented like as you suggested.Is there any db level configuration?


There is no such setting, the way to go is as described on #2 above.

Note, however, that internally ObjectDB identifies simpler date/time instances, such as in your question, and their storage consumes less space.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login