epam / fix-antenna-net-core

FIX Antenna™ .NET Core is a high-performance low latency .NET FIX Engine.
https://www.b2bits.com/trading_solutions/fix_engines/fix_engine_net-core
Apache License 2.0
36 stars 15 forks source link

Datetime values parser #72

Open jirisacha opened 2 years ago

jirisacha commented 2 years ago

I have a question about parsing datetime values, specifically year values.

In several places in the code, validation is used against the hard coded value 1582, which is the beginning of the Gregorian calendar. But according to the FIX specification, any value between 0000 and 9999 should be valid for the year. Moreover, particular value 1582 has no practical meaning for today's trading platforms :-)

Is this a bug or is it intentional?

There are trading parties (KBC) that sometimes send 0000 as the year and parsing of such messages throws exception.

OlehVasylievEPAM commented 2 years ago

Hi jirisacha, yes, it is a bug. Thanks for finding it. We will put the bug in our backlog.

Please, let me know if the bug is critical for you and if you need a hotfix ASAP.

jirisacha commented 2 years ago

Thanks for response, it's not a critical bug, we have a workaround, but it would be nice to have a fix in a future release.

jirisacha commented 1 year ago

HI, I can see fix in branch datetime-year-value-parser-validation Could you please merge this branch in upcoming releases?

OlehVasylievEPAM commented 1 year ago

Hi jirisacha,

We do not have a good fix. We can change validation to accept years with 0000 but .NET cannot create DateTime with year 0000.

derMaaster commented 1 year ago

Any chance that you can use NodaTime?

OlehVasylievEPAM commented 1 year ago

Hi derMaaster,

The NodaTime will not help us, because the minimal year is 0001 there and also, it will break the current API.