Network Working Group                                       S. Glassman
Request for Comments: 2550                                   M. Manasse
Category: Stinkards Track                                      J. Mogul
                                            Compaq Computer Corporation
                                                           1 April 1999
        
Network Working Group                                       S. Glassman
Request for Comments: 2550                                   M. Manasse
Category: Stinkards Track                                      J. Mogul
                                            Compaq Computer Corporation
                                                           1 April 1999
        

Y10K and Beyond

Y10K及以上

Status of this Memo

本备忘录的状况

This memo provides information for the Internet community. It does not specify an Internet standard of any kind. Distribution of this memo is unlimited.

本备忘录为互联网社区提供信息。它没有规定任何类型的互联网标准。本备忘录的分发不受限制。

Copyright Notice

版权公告

Copyright (C) The Internet Society (1999). All Rights Reserved.

版权所有(C)互联网协会(1999年)。版权所有。

Abstract

摘要

As we approach the end of the millennium, much attention has been paid to the so-called "Y2K" problem. Nearly everyone now regrets the short-sightedness of the programmers of yore who wrote programs designed to fail in the year 2000. Unfortunately, the current fixes for Y2K lead inevitably to a crisis in the year 10,000 when the programs are again designed to fail.

随着千年的临近,人们对所谓的“Y2K”问题给予了极大的关注。现在几乎每个人都对过去程序员的短视感到遗憾,他们编写的程序设计在2000年失败。不幸的是,目前针对Y2K的修复方案不可避免地导致了10000年的危机,而这一年的计划又注定要失败。

This specification provides a solution to the "Y10K" problem which has also been called the "YAK" problem (hex) and the "YXK" problem (Roman numerals).

本规范提供了“Y10K”问题的解决方案,该问题也称为“YAK”问题(十六进制)和“YXK”问题(罗马数字)。

1. Introduction, Discussion, and Related Work
1. 介绍、讨论和相关工作

Many programs and standards contain, manipulate and maintain dates. Comparing and sorting dates is a common activity. Many different formats and standards for dates have been developed and all have been found wanting.

许多程序和标准包含、操作和维护日期。比较和排序日期是一项常见的活动。已经制定了许多不同的日期格式和标准,并且发现所有这些格式和标准都是不足的。

Early date formats reserved only two digits to represent the year portion of a date. Programs that use this format make mistakes when dealing with dates after the year 2000. This is the so-called Y2K problem.

早期日期格式仅保留两位数字以表示日期的年份部分。使用这种格式的程序在处理2000年之后的日期时会出错。这就是所谓的Y2K问题。

The most common fix for the Y2K problem has been to switch to 4-digit years. This fix covers roughly the next 8,000 years (until the year 9999) by which time, everyone seems convinced that all current programs will have been retired. This is exactly the faulty logic and lazy programming practice that led to the current Y2K problem! Programmers and designers always assume that their code will eventually disappear, but history suggests that code and programs are often used well past their intended circumstances.

解决Y2K问题最常见的方法是切换到4位数的年份。这一修正案涵盖了大约8000年(直到9999年),到那时,所有人似乎都相信当前的所有程序都将退役。这正是导致当前Y2K问题的错误逻辑和懒惰编程实践!程序员和设计师总是认为他们的代码最终会消失,但历史表明,代码和程序的使用往往远远超出了预期的环境。

The 4-digit year leads directly to programs that will fail in the year 10,000. This proposal addresses the Y10K problem in a general way that covers the full range of date and time format issues.

4位数的年份直接导致项目在10000年失败。本提案以涵盖所有日期和时间格式问题的一般方式解决Y10K问题。

1.1 Current approaches
1.1 当前方法

A large number of approaches exist for formatting dates and times. All of them have limitations. The 2-digit year runs into trouble next year. The 4-digit year hits the wall in the year 10,000. A 16-bit year runs out in the year 65,536. A 32-bit counter for the number of seconds since 1970 [UNIX] wraps in 2038. A 32-bit counter for the number of milli-seconds since booting crashes a Windows (TM) PC in 49.7 days [Microsoft].

存在大量格式化日期和时间的方法。它们都有局限性。两位数的年份明年将陷入困境。4位数的年份在10000年撞上了墙。16位年份将在65536年结束。表示自1970年[UNIX]以来秒数的32位计数器包装在2038年。32位计数器,表示49.7天内Windows(TM)PC启动崩溃后的毫秒数[Microsoft]。

In this specification, we focus on the Y10K problems since they are most common and a large number of existing standards and protocols are susceptible to them (section 7). These standards, and new proposals on their way, will lead to a serious world-wide problem unless efforts are made now to correct the computing, government, and business communities.

在本规范中,我们将重点关注Y10K问题,因为它们是最常见的问题,并且大量现有标准和协议容易受到这些问题的影响(第7节)。这些标准以及即将出台的新提案将导致一个严重的世界性问题,除非现在做出努力纠正计算机、政府和商业界的错误。

Already, a small cottage industry is popping up to deal with the Y10K problem [YUCK]. We encourage these efforts and, in the coming years, this effort can only grow in size and importance.

目前,一个小型家庭手工业正在兴起,以解决10万日元的问题[糟糕]。我们鼓励这些努力,在今后几年中,这一努力的规模和重要性只会越来越大。

1.2 A Fixed Format Y10K Fix
1.2 固定格式Y10K修复程序

At the time of this writing, only one proposal [Wilborne] directly deals with the Y10K problem. In that proposal, dates are represented as decimal numbers with the dates compared numerically. The proposed format is simply YYYYYMMDD - i.e. 5-digit years.

在撰写本文时,只有一项提案[Wilborne]直接涉及Y10K问题。在该提案中,日期以十进制数字表示,并以数字进行比较。建议的格式仅为YYYY MMDD,即5位数年。

To allow numerical comparison of dates, this representation requires a completely fixed representation for the date. There can be no optional fields, the date resolution is limited to the granularity of one day, and this solution fails in the year 100,000 (Y100K).

要允许对日期进行数字比较,此表示法需要日期的完全固定表示法。不能有可选字段,日期解析限制为一天的粒度,并且此解决方案在100000年(Y100K)内失败。

1.2.2 Limitations of Numerical Comparison
1.2.2 数值比较的局限性

While sufficient for the specific Y10K problem, this solution is limited. Even if extended for 6-digit years, it fails on 32-bit systems (and future 32-bit system emulators) after the date represented by the number 2147481231 (December 31, 214748) leading to a Y214749 problem. Similarly, 64-bit and 128-bit systems also will fail, although somewhat later (after December 31, 922,337,203,685,477 and December 31, 17,014,118,346,046,923,173,168,730,371,588,410 respectively).

虽然对于特定的Y10K问题已经足够了,但该解决方案是有限的。即使延长6位数年,在数字2147481231(214748年12月31日)表示的日期之后,它在32位系统(以及未来的32位系统仿真器)上也会失败,从而导致Y214749问题。同样,64位和128位系统也会出现故障,尽管会晚一些(分别在12月31日922337203685477和12月31日17014118346046923173168730371588410之后)。

1.2.3 Granularity Issues
1.2.3 粒度问题

The granularity problems of a fixed format date can be improved by extending the date format to include greater precision in the date. However, since numerical comparison of dates requires a fixed representation date, an extended format can not provide sufficient resolution for all foreseeable needs.

固定格式日期的粒度问题可以通过扩展日期格式以在日期中包含更高的精度来改进。然而,由于日期的数字比较需要一个固定的表示日期,因此扩展格式不能为所有可预见的需求提供足够的分辨率。

For instance, if the precision were extended to the femto-second range the date format would become YYYYYMMDDHHMMSSmmmuuunnnpppfff (year, month, day, hour, minute, second, milli-second, micro-second, nano-second, pico-second, and femto-second). The additional 21 digits of this format limit the set of representable dates. Compared to 1.2.2, the 32-bit and 64-bit forms of the date are instantly exceeded, while the 128-bit version would be viable - expiring on December 31, 17,014,118,346,046.

例如,如果精度扩展到毫微秒范围,则日期格式将变为YYYY MMDDHHMMSMMUUNNPPPFFF(年、月、日、小时、分钟、秒、毫秒、微秒、纳秒、皮秒和毫微秒)。此格式的额外21位数字限制了可表示日期的设置。与1.2.2相比,该日期的32位和64位格式会立即被超过,而128位版本则是可行的,将于17014118346046年12月31日到期。

1.2.3.1 Extrapolation of Future Granularity Issues
1.2.3.1 对未来粒度问题的推断

However, a simple extrapolation of Moore's law shows that even femto-second resolution will soon be inadequate. Projecting current CPU clock speeds forward, a femto-second clock speed will be achieved in only 30 years. And, by the year 10,000 the projected clock speed of the Intel Pentium MMDCLXVI (TM) will be approximately 10 ** (- 1609) seconds.

然而,对摩尔定律的简单推断表明,即使是飞秒分辨率也很快会不够。将当前的CPU时钟速度向前投射,仅在30年内即可达到飞秒时钟速度。到了10000年,英特尔奔腾MMDCLXVI(TM)的预计时钟速度将约为10**(-1609)秒。

This discussion clearly shows that any fixed-format, integer representation of a date is likely to be insufficiently precise for future uses.

这一讨论清楚地表明,日期的任何固定格式、整数表示对于将来的使用可能不够精确。

1.2.3.2 Floating Point Is No Solution
1.2.3.2 浮点不是解决方案

The temptation to use floating point numbers to represent dates should be avoided. Like the longer fixed-format, integer representations of the date, floating point representations merely delay the inevitable time when their range is exceeded. In addition,

应该避免使用浮点数表示日期的诱惑。与较长的固定格式一样,日期的整数表示形式,浮点表示形式只是延迟超出其范围时不可避免的时间。此外

the well known problems of real numbers - rounding, de-normalization, non-uniform distribution, etc. - just add to the problems of dealing with dates.

众所周知的实数问题——四舍五入、非标准化、非均匀分布等——只是增加了处理日期的问题。

2 Structure of Y10K Solution

2 Y10K溶液的结构

Any Y10K solution should have the following characteristics.

任何Y10K溶液都应具有以下特征。

2.1 Compatibility
2.1 兼容性

The format must be compatible with existing 4-digit date formats. Y2K compliant programs and standards must continue to work with Y10K dates before the year 10,000. Y10K compliant programs can gradually be developed over time and coexist with non-Y10K compliant programs.

该格式必须与现有的4位日期格式兼容。符合Y2K标准的计划和标准必须在10000年之前的10万日元的日期继续有效。Y10K兼容项目可以随着时间的推移逐渐发展,并与非Y10K兼容项目共存。

2.2 Simplicity and Efficiency
2.2 简单高效

Y10K dates must allow dates after 10,000 to be easily identified. Within a program, there must be a simple procedure for recognizing the Y10K dates and distinguishing them from legacy dates.

Y10K日期必须使10000之后的日期易于识别。在程序中,必须有一个简单的程序来识别Y10K日期并将其与遗留日期区分开来。

2.3 Lexical Sorting
2.3 词汇排序

Y10K dates must be sortable lexically based on their ASCII representation. The dates must not require specialized libraries or procedures.

Y10K日期必须根据其ASCII表示形式进行词汇排序。日期不得要求专门的库或程序。

2.4 Future Extensibility
2.4 未来可扩展性

Y10K dates must support arbitrary precision dates, and should support dates extending arbitrarily far into the future and past. Y10K dates from different eras and with different precisions must be directly comparable and sortable.

Y10K日期必须支持任意精确日期,并且应支持任意延伸到未来和过去的日期。来自不同时代和不同精度的Y10K日期必须具有直接可比性和可排序性。

2.4.1 Environmental Considerations
2.4.1 环境考虑

The known universe has a finite past and future. The current age of the universe is estimated in [Zebu] as between 10 ** 10 and 2 * 10 ** 10 years. The death of the universe is estimated in [Nigel] to occur in 10 ** 11 - years and in [Drake] as occurring either in 10 ** 12 years for a closed universe (the big crunch) or 10 ** 14 years for an open universe (the heat death of the universe).

已知的宇宙有一个有限的过去和未来。目前宇宙的年龄以[Zebu]为单位估计为10*10到2*10*10年之间。在[Nigel]中,宇宙的死亡预计在10**11年内发生,在[Drake]中,封闭宇宙的死亡预计在10**12年内发生(大危机),开放宇宙的死亡预计在10**14年内发生(宇宙热死亡)。

In any case, the prevailing belief is that the life of the universe (and thus the range of possible dates) is finite.

在任何情况下,普遍的信念是宇宙的生命(因此可能的日期范围)是有限的。

2.4.2 Transcending Environmental Considerations
2.4.2 超越环境考虑

However, we might get lucky. So, Y10K dates are able to represent any possible time without any limits to their range either in the past or future.

然而,我们可能会很幸运。因此,Y10K日期能够代表任何可能的时间,而不受其过去或未来范围的任何限制。

Y10K compliant programs MAY choose to limit the range of dates they support to those consistent with the expected life of the universe. Y10K compliant systems MUST accept Y10K dates from 10 ** 12 years in the past to 10 ** 20 years into the future. Y10K compliant systems SHOULD accept dates for at least 10 ** 29 years in the past and future.

Y10K兼容计划可以选择将其支持的日期范围限制为与宇宙预期寿命一致的日期。符合Y10K标准的系统必须接受过去10**12年到未来10**20年的Y10K日期。Y10K兼容系统应接受过去和未来至少10**29年的日期。

3 Syntax Overview

3语法概述

The syntax of Y10K dates consists of simple, printable ASCII characters. The syntax and the characters are chosen to support a simple lexical sort order for dates represented in Y10K format. All Y10K dates MUST conform to these rules.

Y10K日期的语法由简单、可打印的ASCII字符组成。选择语法和字符是为了支持以Y10K格式表示的日期的简单词汇排序顺序。所有Y10K日期必须符合这些规则。

Every Y10K date MUST begin with a Y10K year. Following the year, there MAY be an arbitrary sequence of digits. The digits are interpreted as MMDDHHMMSSmmmuuunnnpppfff... (month, day, hour, minute, second, milli-second, micro-second, nano-second pico-second, femto-second, etc. - moving left to right in the date, digits always decrease in significance).

每个10万日元的日期必须以10万日元的年份开始。年份之后,可能有任意数字序列。这些数字被解释为mmddhhmmsmmuunnpppfff。。。(月、日、小时、分钟、秒、毫秒、微秒、纳秒皮秒、飞秒等-日期从左向右移动,数字的重要性始终降低)。

All dates and times MUST be relative to International Atomic Time (TAI) [NRAO].

所有日期和时间必须与国际原子时(TAI)[NRAO]相关。

When comparing dates, a date precedes every other date for which it is a prefix. So, the date "19990401000000" precedes the date "19990401000000000". In particular, dates with the format YYYYMMDD are interpreted to represent the exact instant that the day begins and precede any other date contained in that day.

当比较日期时,一个日期在它作为前缀的其他日期之前。因此,日期“19990401000000”先于日期“1999040100000000”。特别是,格式为YYYYMMDD的日期被解释为表示一天开始的确切时刻,并在该天包含的任何其他日期之前。

3.1 Years 1 - 9999
3.1 第1-9999年

The current 4-digit year syntax covers all years from 1000 - 9999. These years are represented as 4 decimal digits. Leading 0's MUST be added to the years before 1000 to bring the year to 4 digits. Files containing legacy pre-Y1K [Mike] dates will have to be converted.

当前的4位年份语法涵盖1000-9999之间的所有年份。这些年份用4位小数表示。必须将前导0添加到1000之前的年份,才能将年份设置为4位数。必须转换包含Y1K[Mike]之前遗留日期的文件。

3.2 Years 10,000 through 99,999
3.2 10000年至99999年

Four digits are not sufficient to represent dates beyond the year 9999. So, all years from 10,000 - 99,999 are represented by 5 digits preceded by the letter 'A'. So, 10,000 becomes "A10000" and 99,999

四位数字不足以表示9999年之后的日期。因此,从10000年到99999年的所有年份都由字母“A”前面的5位数字表示。因此,10000变为“A10000”和99999

becomes "A99999". Since 'A' follows '9' in the ASCII ordering, all dates with 5-digit years will follow all dates with 4-digit years (for example, "A10000" will sort after "9999"). This gives us the sort and comparison behaviour we want.

变成“A99999”。由于ASCII排序中“A”紧跟在“9”之后,所有5位数年份的日期都将紧跟在所有4位数年份的日期之后(例如,“A10000”将在“9999”之后排序)。这给了我们想要的排序和比较行为。

3.3 Years 100,000 up to 10 ** 30
3.3 10万年至10**30

By a simple generalization of 3.2, 6-digit years are preceded by the letter 'B', 7-digit years by 'C', etc. Using just the 26 upper-case ASCII characters, we can cover all years up to 10**30 (the last year representable is "Z999999999999999999999999999999"). Again, since the ASCII characters are sorted alphabetically, all dates sort appropriately.

通过3.2的简单概括,6位年份前加字母“B”,7位年份前加字母“C”等。仅使用26个大写ASCII字符,我们就可以覆盖10**30(最后一年表示为“Z99999999999999999999”)以内的所有年份。同样,由于ASCII字符是按字母顺序排序的,因此所有日期的排序都是适当的。

3.4 Years 10 ** 30 and beyond (Y10**30)
3.4 10年**30及以上(Y10**30)

As discussed in 2.4.1, the end of the universe is predicted to occur well before the year 10 ** 30. However, if there is one single lesson to be learned from the current Y2K problems, it is that specifications and conventions have a way of out living their expected environment. Therefore we feel it is imperative to completely solve the date representation problem once and for all.

如第2.4.1节所述,宇宙末日预计将在10*30年之前发生。然而,如果说从当前的Y2K问题中可以吸取一个教训的话,那就是规范和惯例有一条脱离预期环境的道路。因此,我们认为必须一劳永逸地彻底解决日期表示问题。

3.4.1 Naive Approach for Y10**30 Problem
3.4.1 Y10**30问题的简单方法

The naive solution is to prepend a single '^' (caret) - caret sorts after all letters in the ASCII order) before all years from 10 ** 30 to 10 ** 56. Thus the year "Z999999999999999999999999999999" is followed by the year "^A1000000000000000000000000000000". Similarly, all years from 10 ** 56 to 10 ** 82 get one more caret. So, the year "^Z99999999999999999999999999999999999999999999999999999999" is followed by the year "^^A100000000000000000000000000000000000000000000000000000000". This scheme can be extended indefinitely by prepending one addition caret for each additional factor of 10 ** 26 in the range of the year.

最简单的解决方案是在10**30到10**56之间的所有年份之前,在所有字母(按ASCII顺序)后面加一个“^”(插入符号)-插入符号排序。因此,年份“Z99999999999999999999999999999999999”后面紧跟着年份“^A100000000000000000000000000000”。同样地,从10**56到10**82的所有年份都会多加一个插入符号。因此,年份“^Z999999999999999999999999999999999999999999999999999999999999999999999999999999999”后面紧跟着年份“^A100000000000000000000000000000000000000000000”。该方案可以无限期延长,在一年的范围内,每增加一个系数10**26,就预先添加一个插入符号。

In this approach, the number of digits in a date that are used to represent the year is simply:

在这种方法中,日期中用于表示年份的位数为:

      26 * <number of '^'> + ASCII(<prefix letter>) - ASCII('A') + 5
        
      26 * <number of '^'> + ASCII(<prefix letter>) - ASCII('A') + 5
        

Note: this algorithm is provided for informational purposes only and to show the path leading to the true solution. Y10K dates MUST NOT use this format. They MUST use the format in the next section.

注意:此算法仅供参考,用于显示通向真正解决方案的路径。Y10K日期不得使用此格式。他们必须使用下一节中的格式。

3.4.2 Space Efficient Approach for Y10**30 Problem
3.4.2 Y10**30问题的空间有效方法

The solution in 3.4.1 is not a space efficient format for giving the number of digits in the year. The length of the prefix grows linearly in the length of the year (which, itself, grows logarithmically over time). Therefore, Y10K format dates use an improved, more compact encoding of the number of digits in the year.

3.4.1中的解决方案不是一种节省空间的格式,用于给出年份中的位数。前缀的长度在一年中呈线性增长(其本身随时间呈对数增长)。因此,Y10K格式的日期使用了一种改进的、更紧凑的数字编码。

3.4.2.1 Years 10 ** 30 to 10 ** 56
3.4.2.1 年份10**30至10**56

As in 3.4.1, a single '^' and letter precede the year.

如3.4.1所示,一个“^”和字母在年份之前。

3.4.2.2 Years 10 ** 56 to 10 ** 732
3.4.2.2 年份10**56至10**732

The year is preceded by two carets ("^^") and two letters. The letters create a two digit, base 26 number which is the number of digits in the year minus 57. So, the year "^Z99999999999999999999999999999999999999999999999999999999" is followed by the year "^^AA100000000000000000000000000000000000000000000000000000000". The last representable year with two carets is the year (10 ** 732) - 1 and is "^^ZZ999..999" (i.e. two carets and two Z's, followed by 732 consecutive 9's).

年份前有两个插入符号(“^^”)和两个字母。这些字母构成了一个以26为基数的两位数,即当年的位数减去57。因此,年份“^Z999999999999999999999999999999999999999999999999999999999999999999999999999999999999”后面紧跟着年份“^AA10000000000000000000000000000000000000000000”。带有两个插入符号的最后一个可表示年份是年份(10**732)-1,是“^^ZZ999..999”(即两个插入符号和两个Z,然后是732个连续的9)。

The formula for the number of digits in the year is, based on the two digit prefix is:

根据两位数前缀,年份的位数公式为:

    26 * (ASCII(<prefix letter1>) - ASCII('A')) +
          ASCII(<prefix letter2>) - ASCII('A') + 57
        
    26 * (ASCII(<prefix letter1>) - ASCII('A')) +
          ASCII(<prefix letter2>) - ASCII('A') + 57
        
3.4.2.3 Years 10 ** 732 to 10 ** 18308
3.4.2.3 年份10**732至10**18308

The next block of years has the number of digits given by three carets ("^^^") followed by three letters forming a three-digit, base 26 number. The number of digits in the year is given by the formula:

下一个年份块的数字由三个插入符号(“^^^”)和三个字母组成,构成一个以26为基数的三位数字。年份中的位数由公式给出:

    676 * (ASCII(<prefix letter1>) - ASCII('A')) +
     26 * (ASCII(<prefix letter2>) - ASCII('A')) +
           ASCII(<prefix letter3>) - ASCII('A') + 733
        
    676 * (ASCII(<prefix letter1>) - ASCII('A')) +
     26 * (ASCII(<prefix letter2>) - ASCII('A')) +
           ASCII(<prefix letter3>) - ASCII('A') + 733
        
3.4.2.4 General Format for Y10K Dates
3.4.2.4 Y10K日期的通用格式

In general, if there is at least one letter in a Y10K year, the number of the digits in the year portion of the date is given by the formula:

一般来说,如果一个10万日元的年份中至少有一个字母,则日期年份部分的位数由公式给出:

       base26(fib(n) letters) + y10k(n)
        
       base26(fib(n) letters) + y10k(n)
        

Where "n" is the number of leading carets and the fig, base26 and y10k functions are defined with the following recurrence relations:

其中“n”是前导插入符号的数量,fig、base26和y10k函数定义为以下递推关系:

fib(n) is the standard Fibonacci sequence with:

fib(n)是标准的斐波那契序列,具有:

fib(0) = 1

fib(0)=1

fib(1) = 1

fib(1)=1

      fib(n+2) = fib(n) + fib(n+1)
        
      fib(n+2) = fib(n) + fib(n+1)
        

base26(m letters) is the base 26 number represented by m letters A-Z:

base26(m个字母)是以m个字母A-Z表示的base26数字:

      base26(letter) =  ASCII(<letter>) - ASCII('A')
      base26(string letter) = 26 * base26(string) + base26(letter)
        
      base26(letter) =  ASCII(<letter>) - ASCII('A')
      base26(string letter) = 26 * base26(string) + base26(letter)
        

y10k(n) is the necessary fudge factor to align the sequences

y10k(n)是对齐序列所必需的模糊因子

properly:

适当地:

      y10k(0) = 5
      y10k(n+1) = 26 ** fib(n) + y10k(n)
        
      y10k(0) = 5
      y10k(n+1) = 26 ** fib(n) + y10k(n)
        

If the year does not have at least one letter in the year, then the number of digits in the year is:

如果年份中没有至少一个字母,则年份中的位数为:

4

4.

This year format is space-efficient. The length of the prefix giving number of digits in the year only grows logarithmically with the number of digits in the year. And, the number of carets preceding the prefix only grows logarithmically with the number of digits in the prefix.

今年的格式是节省空间的。给出一年中位数的前缀的长度仅随一年中位数的对数增长。而且,前缀前面的插入符号数仅与前缀中的位数成对数增长。

3.5 B.C.E. (Before Common Era) Years
3.5 B.C.E.(普通纪元之前)年

Now that have a format for all of the years in the future, we'll take on the "negative" years. A negative year is represented in "Y10K-complement" form. A Y10K-complement year is computed as follows:

现在有了未来所有年份的格式,我们将采用“消极”年份。负年份以“Y10K补码”形式表示。10万日元的补足年计算如下:

    1) Calculate the non-negative Y10K year string as in 3.4.2.4.
    2) Replace all letters by their base 26 complement.  I.E. A -> Z, B
       -> Y, ... Z -> A.
    3) Replace all digits in the year portion of the date by their base
       10 complement.  I.E. 0 -> 9, 1 -> 8, ... 9 -> 0.
    4) Replace carets by exclamation points ('!').
    5) Four-digit years are pre-pended with a slash ('/')
        
    1) Calculate the non-negative Y10K year string as in 3.4.2.4.
    2) Replace all letters by their base 26 complement.  I.E. A -> Z, B
       -> Y, ... Z -> A.
    3) Replace all digits in the year portion of the date by their base
       10 complement.  I.E. 0 -> 9, 1 -> 8, ... 9 -> 0.
    4) Replace carets by exclamation points ('!').
    5) Four-digit years are pre-pended with a slash ('/')
        

6) Years that don't now begin with an exclamation point or slash are pre-pended with a star ('*'). (This rule covers the negative 5- 31 digit years).

6) 现在不以感叹号或斜杠开头的年份将用星号(“*”)进行标记。(此规则涵盖负5-31位年份)。

For example, the year 1 BCE is represented by "/9998". The conversion is accomplished by applying rules:

例如,公元前1年用“/9998”表示。转换通过应用规则来完成:

1) Calculate the non-negative Y10K year ("1" -> "0001") 2) Complement the digits ("0001" -> "9998") 3) Four-digit numbers get a leading slash.

1) 计算非负的10千日元年份(“1”->“0001”)2)补全数字(“0001”->“9998”)3)四位数字得到一个前导斜杠。

The earliest four-digit BCE year (9999 BCE) becomes "/0000" and the year before that (10000 BCE) becomes "*Z89999". The earliest 5-digit BCE year (99999 BCE) is "*Z00000". And the year before that (100000 BCE) is "*Y899999". And so on.

最早的四位数公元前一年(公元前9999年)变为“/0000”,之前的一年(公元前10000年)变为“*Z89999”。最早的5位数BCE年份(公元前99999年)为“*Z00000”。而在此之前的一年(公元前100000年)是“*899999日元”。等等

These rules give the desired sort order for BCE dates. For example, the following dates get translated and sorted as: Jun 6, 200 BCE /97990606 199 BCE /9800 Jan 1, 199 BCE /98000101

这些规则为BCE日期提供所需的排序顺序。例如,以下日期被翻译和排序为:公元前200年6月6日/97990606199BCE/9800公元前199年1月1日/9800001

3.6 Restrictions on Y10K Dates
3.6 对10万日元日期的限制

There are no restrictions on legal values for Y10K dates. Y10K compliant programs MUST accept any syntactically legal Y10K date as a valid date. A '0' can be appended to the end of any Y10K date, yielding an equivalent date that sorts immediately after the original date and represents the instant after the original date.

10万日元日期的法定值没有限制。Y10K兼容程序必须接受任何语法上合法的Y10K日期作为有效日期。“0”可以附加到任何Y10K日期的末尾,生成一个在原始日期之后立即排序的等效日期,并表示原始日期之后的瞬间。

The following are all valid representations (in sorted order) of the first instant of A10000:

以下是A10000第一个瞬间的所有有效表示(按排序顺序):

     A1
     A10000
     A1000001
     A100000101000000
     A1000001010000000000000000000000
        
     A1
     A10000
     A1000001
     A100000101000000
     A1000001010000000000000000000000
        

Similarly, the following are all valid Y10K dates (in sorted order) for the time after the last instant of the A99999 and before the first instant of B100000:

同样,以下是A99999最后一刻之后和B100000第一刻之前的所有有效Y10K日期(按排序顺序):

A999991231250000 A999991232 A999992 A9999999999 A99999999990000000000000

A99991231250000 A99991232 A9999992 A999999999999999000000000000000000

4 ABNF

4荷兰银行

The following ABNF [Crocker] gives the formal syntax for Y10K years.

以下ABNF[Crocker]给出了10万年的正式语法。

The initial characters definitions are given in their lexical collation (ASCII) order.

初始字符定义按词法排序规则(ASCII)顺序给出。

   exclamation = '!'
   star        = '*'
   slash       = '/'
   digit       =  0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
   letter      =  A | B | C | D | E | F | G | H | I | J | K | L | M |
        
   exclamation = '!'
   star        = '*'
   slash       = '/'
   digit       =  0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
   letter      =  A | B | C | D | E | F | G | H | I | J | K | L | M |
        

N | O | P | Q | R | S | T | U | V | W | X | Y | Z caret = '^'

N | O | P | Q | R | S | T | U | V | W | X | Y | Z插入符号='^'

   year     = [*(caret | exclamation) | star | slash ] [ *letter ]
             *digit
   month    = 2digit
   day      = 2digit
   hour     = 2digit
   minute   = 2digit
   second   = 2digit
   fraction = *digit
   date     = year [ month [ day [ hour [ minute [ second [ fraction
             ]]]]]]
        
   year     = [*(caret | exclamation) | star | slash ] [ *letter ]
             *digit
   month    = 2digit
   day      = 2digit
   hour     = 2digit
   minute   = 2digit
   second   = 2digit
   fraction = *digit
   date     = year [ month [ day [ hour [ minute [ second [ fraction
             ]]]]]]
        

5 Open Issues

5未决问题

There are a number date comparison problems that are beyond the scope of this specification.

存在一些超出本规范范围的数字日期比较问题。

1) Dates from different calendar systems can not be directly compared. For instance, dates from the Aztec, Bhuddist, Jewish, Muslim, and Hittite calendars must be converted to a common calendar before comparisons are possible.

1) 不能直接比较不同日历系统的日期。例如,阿兹特克日历、布迪斯特日历、犹太日历、穆斯林日历和赫梯日历的日期必须转换为通用日历,才能进行比较。

2) Future re-numberings of years are not covered. If, and when, a new "Year 0" occurs and comes into general use, old dates will have to be adjusted.

2) 不包括未来年份的重新编号。如果新的“0年”出现并开始普遍使用,则必须调整旧日期。

3) Continued existence of Earth-centric time periods (year, day, etc.) are problematical past the up-coming destruction of the solar system (5-10 billion years or so). The use of atomic-time helps some since leap seconds are no longer an issue.

3) 在即将到来的太阳系毁灭(50-100亿年左右)之后,以地球为中心的时间周期(年、日等)的持续存在是有问题的。原子时的使用帮助了一些人,因为闰秒不再是一个问题。

4) Future standards and methods of synchronization for inter-planetary and inter-galactic time have not been agreed to.

4) 行星间和银河系间时间的未来同步标准和方法尚未达成一致。

5) Survivability of dates past the end of the universe is uncertain.

5) 超过宇宙末日的日期的生存能力是不确定的。

6 Affected Standards

6受影响的标准

A number of standards currently and RFCs use 4-digit years and are affected by this proposal:

目前,许多标准和RFC使用4位数年份,并受本提案的影响:

rfc2459: Internet X.509 Public Key Infrastructure Certificate and CRL Profile rfc2326: Real Time Streaming Protocol (RTSP) rfc2311: ODETTE File Transfer Protocol rfc2280: Routing Policy Specification Language (RPSL) rfc2259: Simple Nomenclator Query Protocol (SNQP) rfc2244: ACAP -- Application Configuration Access Protocol rfc2167: Referral Whois (RWhois) Protocol V1.5 rfc2065: Domain Name System Security Extensions rfc2060: Internet Message Access Protocol - Version 4rev1 rfc1922: Chinese Character Encoding for Internet Messages rfc1912: Common DNS Operational and Configuration Errors rfc1903: Textual Conventions for Version 2 of the Simple Network Management Protocol (SNMPv2) rfc1521: MIME (Multipurpose Internet Mail Extensions) Part One:

rfc2459:Internet X.509公钥基础设施证书和CRL配置文件rfc2326:实时流协议(RTSP)rfc2311:ODETTE文件传输协议rfc2280:路由策略规范语言(RPSL)rfc2259:简单命名查询协议(SNQP)rfc2244:ACAP——应用程序配置访问协议rfc2167:引用Whois(RWhois)协议V1.5 rfc2065:域名系统安全扩展rfc2060:Internet消息访问协议-版本4rev1 rfc1922:Internet消息的汉字编码rfc1912:常见DNS操作和配置错误rfc1903:简单网络管理协议(SNMPv2)版本2的文本约定rfc1521:MIME(多用途Internet邮件扩展)第一部分:

rfc1123: Requirements for Internet hosts - application and support

rfc1123:互联网主机的要求-应用程序和支持

The following standards internally represent years as 16-bit numbers (0..65536) and are affected by this proposal:

以下标准在内部以16位数字(0..65536)表示年份,并受本提案的影响:

rfc2021: Remote Network Monitoring Management Information Base Version 2 using SMIv2 rfc1514: Host Resources MIB

rfc2021:使用SMIv2 rfc1514的远程网络监视管理信息库版本2:主机资源MIB

The following ISO standard is affected: ISO8601: International Date Format

以下ISO标准受影响:ISO8601:国际日期格式

8 Security Considerations

8安全考虑

Y10K dates will improve the security of all programs where they are used. Many errors in programs have been tracked to overflow while parsing illegal input. Programs allocating fixed size storage for dates will exhibit errors when presented with larger dates. These errors can be exploited by wily hackers to compromise the security of systems running these programs. Since Y10K dates are arbitrary length strings, there is no way to make them overflow.

Y10K日期将提高所有使用它们的程序的安全性。在解析非法输入时,程序中的许多错误被跟踪到溢出。为日期分配固定大小存储的程序在显示较大日期时会显示错误。狡猾的黑客可以利用这些错误来危害运行这些程序的系统的安全。由于Y10K日期是任意长度的字符串,因此无法使其溢出。

In addition, positive Y10K dates are easy to compare and less error-prone for humans. It is easier to compare the three projected end of the universe dates - "H100000000000", "I1000000000000" and "K100000000000000" - by looking at the leading letter than by counting the 0's. This will reduce inadvertent errors by people. This advantage will become more noticeable when large dates are more common.

此外,积极的Y10K日期很容易比较,人类也不容易出错。比较三个预测的宇宙末日——“H100000000000”、“I10000000000”和“K100000000000000”——通过查看前导字母比计算0更容易。这将减少人们无意中的错误。当大型日期更为常见时,这一优势将变得更加明显。

Unfortunately, negative Y10K dates are a bit more difficult to decipher. However, by comparing the current age of the universe to its projected end, it is obvious that there will be many more positive dates than negative dates. And, while the number of negative dates for human history is currently greater than the number of positive dates, the number of negative dates is fixed and the number of positive dates is unbounded.

不幸的是,负的Y10K日期更难解读。然而,通过比较宇宙的当前年龄和它的预测终点,很明显,肯定日期要比否定日期多得多。而且,尽管人类历史上消极日期的数量目前大于积极日期的数量,但消极日期的数量是固定的,积极日期的数量是无限的。

9 Conclusion

9结论

It is not too early to aggressively pursue solutions for the Y10K problem. This specification presents a simple, elegant, and efficient solution to this problem.

现在积极寻求解决Y10K问题的方案还为时过早。本规范为该问题提供了一个简单、优雅、高效的解决方案。

10 References

10份参考资料

[Crocker] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997.

[Crocker]Crocker,D.和P.Overell,“语法规范的扩充BNF:ABNF”,RFC 2234,1997年11月。

   [Drake]     Review for the Drake Equation
               http://www.umsl.edu/~bwilking/assign/drake.html
        
   [Drake]     Review for the Drake Equation
               http://www.umsl.edu/~bwilking/assign/drake.html
        
   [Microsoft] SNMP SysUpTime Counter Resets After 49.7 Days
               http://support.microsoft.com/support/kb/articles/Q169/
               8/47.asp
        
   [Microsoft] SNMP SysUpTime Counter Resets After 49.7 Days
               http://support.microsoft.com/support/kb/articles/Q169/
               8/47.asp
        
   [Mike]      Y1K http://lonestar.texas.net/~mdlvas/y1k.htm
        
   [Mike]      Y1K http://lonestar.texas.net/~mdlvas/y1k.htm
        
   [Nigel]     Nigel's (en)lighening tour of Thermodynamics for
               Economists ;-) http://www.santafe.edu/~nigel/thermo-
               primer.html
        
   [Nigel]     Nigel's (en)lighening tour of Thermodynamics for
               Economists ;-) http://www.santafe.edu/~nigel/thermo-
               primer.html
        
   [NRAO]      Astronomical Times
               http://sadira.gb.nrao.edu/~rfisher/Ephemerides/times.html
        
   [NRAO]      Astronomical Times
               http://sadira.gb.nrao.edu/~rfisher/Ephemerides/times.html
        
   [RFC]       Here are all the online RFCs. Note: this is a LONG menu.
               http://info.internet.isi.edu/1s/in-notes/rfc/files
        
   [RFC]       Here are all the online RFCs. Note: this is a LONG menu.
               http://info.internet.isi.edu/1s/in-notes/rfc/files
        
   [UNIX]      Year 2000 Issues http://www.rdrop.com/users/caf/y2k.html
        
   [UNIX]      Year 2000 Issues http://www.rdrop.com/users/caf/y2k.html
        
   [Wilborne]  PktCDateLig
               http://www3.gamewood.net/mew3/pilot/pocketc/pktcdate/
               index.html
        
   [Wilborne]  PktCDateLig
               http://www3.gamewood.net/mew3/pilot/pocketc/pktcdate/
               index.html
        
   [YUCK]      Y10K Unlimited Consulting Knowledgebase
               http://www.loyd.net/y10k/index.html
        
   [YUCK]      Y10K Unlimited Consulting Knowledgebase
               http://www.loyd.net/y10k/index.html
        
   [Zebu]      The Search for H0
               http://zebu.uoregon.edu/1997/ph410/l6.html
        
   [Zebu]      The Search for H0
               http://zebu.uoregon.edu/1997/ph410/l6.html
        

11 Authors' Addresses

11作者地址

Steve Glassman Compaq Systems Research Center 130 Lytton Avenue Palo Alto, CA 94301 USA

史蒂夫·格拉斯曼·康柏系统研究中心,美国加利福尼亚州帕洛阿尔托市利顿大道130号,邮编94301

   Phone: +1 650-853-2166
   EMail: steveg@pa.dec.com
        
   Phone: +1 650-853-2166
   EMail: steveg@pa.dec.com
        

Mark Manasse Compaq Systems Research Center 130 Lytton Avenue Palo Alto, CA 94301 USA

美国加利福尼亚州帕洛阿尔托市利顿大道130号马克·马纳斯康柏系统研究中心,邮编94301

   Phone: +1 650-853-2221
   EMail: msm@pa.dec.com
        
   Phone: +1 650-853-2221
   EMail: msm@pa.dec.com
        

Jeff Mogul Compaq Western Resarch Lab 250 University Avenue Palo Alto, CA 94301 USA

美国加利福尼亚州帕洛阿尔托大学大道250号杰夫·莫格尔康柏西部研究实验室,邮编94301

   Phone: +1 650-617-3300
   EMail: mogul@pa.dec.com
        
   Phone: +1 650-617-3300
   EMail: mogul@pa.dec.com
        
12. Full Copyright Statement
12. 完整版权声明

Copyright (C) The Internet Society (1999). All Rights Reserved.

版权所有(C)互联网协会(1999年)。版权所有。

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

本文件及其译本可复制并提供给他人,对其进行评论或解释或协助其实施的衍生作品可全部或部分编制、复制、出版和分发,不受任何限制,前提是上述版权声明和本段包含在所有此类副本和衍生作品中。但是,不得以任何方式修改本文件本身,例如删除版权通知或对互联网协会或其他互联网组织的引用,除非出于制定互联网标准的需要,在这种情况下,必须遵循互联网标准过程中定义的版权程序,或根据需要将其翻译成英语以外的其他语言。

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

上述授予的有限许可是永久性的,互联网协会或其继承人或受让人不会撤销。

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

本文件和其中包含的信息是按“原样”提供的,互联网协会和互联网工程任务组否认所有明示或暗示的保证,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。