Story Details

  • Does or did COBOL default to 1875-05-20 for corrupt or missing dates?

    Posted: 2025-02-16 23:56:16

    No, COBOL does not inherently default to 1875-05-20 for corrupt or missing dates. The appearance of this specific date likely stems from particular implementations or custom error handling within specific COBOL systems. The language itself doesn't prescribe this default. Instead, how COBOL handles invalid dates depends on the compiler, runtime environment, and how the program was written. A program might display a default value, a blank date, or trigger an error message, among other possibilities. The 1875-05-20 date is potentially an arbitrary choice made by a programmer or a consequence of how a specific system interprets corrupted data.

    Summary of Comments ( 292 )
    https://news.ycombinator.com/item?id=43073149

    Hacker News users discuss various potential reasons for the 1875-05-20 default date in COBOL, with speculation centering around it being an arbitrary "filler" value chosen by programmers or a remnant of test data. Some commenters suggest it might relate to specific COBOL implementations or be a misinterpretation of a different default behavior, like zeroing out the date field. Others offer alternative explanations, proposing it could represent the earliest representable date in a particular system or stem from a known data corruption issue. A few emphasize the importance of context and specific COBOL versions, noting that the behavior isn't a universal standard. The overall tone suggests the specific date's origin is uncertain and likely varies depending on the system in question.