The SetFromTDateTime() method calls the Zero() method to initialize the TIdDateTimeStamp before adding the TDateTime. However, Zero() sets the initial year and day values to 1, not 0. Even the SetYear() and SetDay() methods force 0 to 1. I do not know why. I did not write TIdDateTimeStamp, I do not know the methodology behind it, but it was clearly intentional behavior, albeit it does seem wrong.
There is an existing ticket for this in Indy's issue tracker, I just haven't gotten around to fixing it yet:
#67: TIdDateTimeStamp.SetFromTDateTime is one year ahead
There is an existing ticket for this in Indy's issue tracker, I just haven't gotten around to fixing it yet:
#67: TIdDateTimeStamp.SetFromTDateTime is one year ahead