问题
I was reading basics of Perl programming language and I came across the following statement
Perl is Y2K compliant.
Did not quite get what it meant even after some Googling. Is it some kind of standard established. if yes then by whom? Any info is appreciated.
回答1:
For those who were programming in the late 1990s, Y2K was of crucial importance. Literally: Y2K
= Year 2000
.
Software that was not Y2K-compliant included, most obviously, software that stored year numbers as 2 digits (often to save storage space), and would therefore have equated the year 2000 to the year 1900. However some software products, for other reasons, were not Y2K compliant because they made incorrect date calculations for dates in the 21st and subsequent centuries.
In the latter category, I had one product that I was maintaining at the time that I had to fix because it didn't recognise the year 2000 as a leap year. As that software ran an automatic control system in a manufacturing plant, it would have damaged some expensive components if it hadn't been fixed before the end of February 2000.
There were some apocalyptic forecasts that very bad things would happen on 1 January 2000 because of software failures due to Y2K non-compliance and a lot of people were "holding their breath" at midnight on 31 December 1999 for that reason. After the fact, many people claimed the forecasts had been exaggerated. In my opinion, there were few problems because a lot of programmers worked very hard and long hours in the late-1990s specifically to deal with the threat of Y2K problems, and they would not have done so if there had not been legitimate concerns about potentially very bad outcomes.
回答2:
The wikipedia article on Y2k, Year 2000 problem, explains this quite good:
In 1997, The British Standards Institute (BSI) developed a standard, DISC PD2000-1, which defines "Year 2000 Conformity requirements" as four rules:
- No valid date will cause any interruption in operations.
- Calculation of durations between, or the sequence of, pairs of dates will be correct whether any dates are in different centuries.
- In all interfaces and in all storage, the century must be unambiguous, either specified, or calculable by algorithm
- Year 2000 must be recognized as a leap year
Perl being Y2k compliant means that its built-in date handling follows these rules.
来源:https://stackoverflow.com/questions/18200744/what-does-y2k-compliant-mean