ObjectDB ObjectDB

How to store and compare Date up to sec.

#1

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.

edit
delete
#2

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.

https://stackoverflow.com/questions/227007/resetting-the-time-part-of-a-timestamp-in-java

ObjectDB Support
edit
delete
#3

Hi 

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

edit
delete
#4

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
edit
delete

Reply

To post on this website please sign in.