Time Formatting and Storage Bugs - Days 32,768 and 65,536

Days 32,768 and 65,536

Programs that store dates as the number of days since an arbitrary date (or epoch) are vulnerable to roll-over or wrap-around effects if the values are not wide enough to allow the date values to span a large enough time range expected for the application. Signed 16-bit binary values roll over after 32,768 (215) days from the epoch date, producing negative values. Some mainframe systems experienced software failures because they had encoded dates as the number of days since 1 January 1900, which produced unexpected negative day numbers on the roll-over date of 18 September 1989. Similarly, unsigned 16-bit binary days counts overflow after 65,536 (216) days, which are truncated to zero values. For software using an epoch of 1 January 1900, this will occur on 6 June 2079.

Read more about this topic:  Time Formatting And Storage Bugs

Famous quotes containing the word days:

    Good manners, Madam, are had these days not
    For your asking, nor mine, nor what-we-used-to-be’s.
    The day is a loud grenade that bursts a smile
    Of serious weeds in a comic lily plot....
    Allen Tate (1899–1979)