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:

    I have heard it said that it took Messrs. Shipman and Hymer [the playwrights] just three- and-a-half days to write their drama. I should like to know what they were doing during the three days.
    Dorothy Parker (1893–1967)