rscada / libmbus

Meter-bus library and utility programs
http://www.rscada.se/libmbus
BSD 3-Clause "New" or "Revised" License
217 stars 137 forks source link

Y2K bug #75

Open lategoodbye opened 10 years ago

lategoodbye commented 10 years ago

The MBDOC48 defines a year (Type F and G) only with 2 digits, but not how to calculate a 4 digit value. Currently libmbus adds simply 2000 to the 2 digit value to get a 4 digit value, which it isn't really correct.

The question is: what is the correct formular to calculate the 4 digit value?

Because i don't have the EN, i can't fix this.

rscada commented 10 years ago

Thanks for reporting this. I am also not sure what would be the most accurate way of handling this, but considering that it is 2014 now, does this have any practical consequences?

lategoodbye commented 10 years ago

This bug is relevant to datetimes in the distant past like production dates or something. I think it's only critical in cases of automatic M-Bus data processing.