它不是“1 个字母 -> 1 个字节”。在定义https://www.rfc-editor.org/rfc/rfc2579.html 时给出的示例与“DISPLAY-HINT”对比中,有 11 个字节(可能是 8 个)并且没有“字母”。取而代之的是 1 个两字节十进制字段、8 个一字节十进制字段和 1 个 1 字节 ASCII 字段。共有 25 个字符,但您的结果可能会有所不同。:
"2d-1d-1d,1d:1d:1d.1d,1a1d:1d" EXAMPLE in DESCRIPTION
"1992-5-26,13:30:15.0,-4:0" "DISPLAY-HINT"
供参考的整个 RFC 部分以及两个相关的勘误表如下所示:
. (这是目前的互联网标准,但自 ~1999 年以来一直存在
TimeInterval ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
"A period of time, measured in units of 0.01 seconds."
SYNTAX INTEGER (0..2147483647)
DateAndTime ::= TEXTUAL-CONVENTION
DISPLAY-HINT "2d-1d-1d,1d:1d:1d.1d,1a1d:1d"
STATUS current
DESCRIPTION
"A date-time specification.
field octets contents range
----- ------ -------- -----
1 1-2 year* 0..65536
2 3 month 1..12
3 4 day 1..31
4 5 hour 0..23
5 6 minutes 0..59
6 7 seconds 0..60
(use 60 for leap-second)
7 8 deci-seconds 0..9
8 9 direction from UTC '+' / '-'
9 10 hours from UTC* 0..13
10 11 minutes from UTC 0..59
* Notes:
- the value of year is in network-byte order
- daylight saving time in New Zealand is +13
For example, Tuesday May 26, 1992 at 1:30:15 PM EDT would be
displayed as:
1992-5-26,13:30:15.0,-4:0
McCloghrie, et al. Standards Track [Page 18]
RFC 2579 Textual Conventions for SMIv2 April 1999
Note that if only local time is known, then timezone
information (fields 8-10) is not present."
SYNTAX OCTET STRING (SIZE (8 | 11))
请注意,此 RFC 有 2 个相关勘误表:
Errata ID: 417
Status: Verified
Type: Technical
Publication Format(s) : TEXT
Reported By: Juergen Schoenwaelder
Date Reported: 2001-07-31
Section 2 says:
RFC 2579 lists an invalid range for the year in the DateAndTime TC:
field octets contents range
----- ------ -------- -----
1 1-2 year* 0..65536
It should say:
field octets contents range
----- ------ -------- -----
1 1-2 year* 0..65535
Errata ID: 416
Status: Verified
Type: Editorial
Publication Format(s) : TEXT
Reported By: Juergen Schoenwaelder
Date Reported: 2004-07-27
The DateAndTime textual convention did not originally define a special value which can be used in situations where a DateAndTime value is unknown or for some other reason not available. Several MIB modules on the IETF standards-track use the value '0000
2 3 month 1..12
3 4 day 1..31
It should say:
2 3 month 0 | 1..12
3 4 day 0 | 1..31