Trouble with DbMJSON DateTime serialization in different time zones



I'm writing little side project to learn some new tools and I decided to use DBreeze as my database engine to extend my knowledge about nosql databases. I followed pdf doc and create first couple of tests to check some basic stuff like inserting and selecting from tables. Sadly one of my tests failed when I tried to use DbMJSON container to store one of my entity classes. Basically I stored DateTime property with current time and when I read it's value it was like two hours earlier. I'm from Poland and we have summer time CEST (UTC+2) right now so it's like there was only one time conversion to UTC. DbXML and simple DateTime storage works perfectly as expected.

Please see attached test project (after changing the time zone ofc)
Best wishes,

file attachments

Closed Jul 16, 2015 at 7:41 AM by hhblaze


hhblaze wrote Jul 16, 2015 at 7:41 AM

Hi, mister, that is not the problem of DBreeze, but Microsoft Json implementation. I recommend you to use Protobuf-NET for fast binary serialization or https://github.com/rpgmaker/NetJSON - the fastest JSON serializer today. Read about custom serializers in DBreeze documentation (sample with protobuf)

bartqc wrote Jul 16, 2015 at 6:04 PM

OK, but I think I would be nice to have DbMJSON working properly out of the box instead of implementing custom serializer, wouldn't be? Right now it's almost usefull out of the box ;)

hhblaze wrote Aug 3, 2015 at 8:25 AM

We don't have ability to change .Net assemblies (which contains Microsoft JavaScriptSerializer implementation). May be I understand you wrong? Then, please, fix an issue and submit a change - I will accept it if it's OK.