RFC 8943

Concise Binary Object Representation (CBOR) Tags for Date

๐Ÿ“… published November 2020, from ietf

Concise Binary Object Representation (CBOR) Tags for Date โœจ

Okay bestie, this RFC is literally about dates ๐Ÿ“…๐ŸŽ€ Here's the title block so you know who's behind it: Michael B. Jones (Microsoft), Anthony Nadalin (Independent), and Jรถrg Richter (pdv Financial Software GmbH) wrote it, it's a Standards Track document, and it was published in November 2020 ๐Ÿ’œ. It doesn't obsolete or update any other RFCs, so it's a fresh little addition to the family ๐ŸŒธ. The ISSN is 2070-1721 and it's an IETF product, so it went through the whole consensus thing ๐Ÿซถ.

Abstract

Okay so, CBOR is the Concise Binary Object Representation, specified in RFC 7049, and its whole vibe is tiny code, pretty small messages, and being extensible without any version negotiation drama โœจ. One way it stays extensible is by defining CBOR tags ๐Ÿ’…. RFC 7049 gave us two time tags: tag 0 (a date/time string as per RFC 3339) and tag 1 (POSIX "seconds since the epoch") โฐ. But then people realized they needed more ๐Ÿ™ˆ. So this spec adds a tag for a date text string (per RFC 3339) for apps that want a textual date in the Gregorian calendar with no time attached ๐Ÿ“. It also adds a tag for days since 1970-01-01 in the Gregorian calendar for apps that want a numeric date with no time ๐Ÿ”ข. This document is the reference for the IANA registration of both tags ๐Ÿฆ‹.

Status of This Memo

This is an Internet Standards Track document. ๐ŸŒˆ

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841. โœจ

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8943. ๐Ÿ”—

Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved. ยฉ๏ธ

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. ๐Ÿ“œ

Table of Contents

1.  Introduction
  1.1.  Calendar Dates
    1.1.1.  Example Date Representations
  1.2.  Comparing Dates
  1.3.  Comparing Dates and Date/Time Values
2.  IANA Considerations
  2.1.  Concise Binary Object Representation (CBOR) Tags
        Registrations
3.  Security Considerations
4.  References
  4.1.  Normative References
  4.2.  Informative References
Acknowledgements
Authors' Addresses

1. Introduction ๐ŸŽ€

Okay, the big picture! CBOR, which is [RFC7049], lets you swap structured data around without needing a schema agreed on beforehand ๐Ÿค. RFC 7049 gave us a basic set of data types and a tagging mechanism, so you can extend the types you support through an IANA registry ๐Ÿ’–.

This spec defines a CBOR tag for a text string that represents a date with no time. The tagged text string follows the [RFC3339] "full-date" production ๐Ÿ“…. Per RFC 3339, that means a date in the Gregorian calendar ๐ŸŒธ.

It also defines a CBOR tag for an integer that represents a date with no time. The tagged integer is an unsigned or negative value giving the number of days since the Gregorian calendar date 1970-01-01 โœจ. Quick implementation aside: this value has a constant offset from the Modified Julian Date, which the Smithsonian Astrophysical Observatory defines as the number of days since November 17, 1858 ๐Ÿงš. The value is the Modified Julian Date minus 40587 ๐Ÿ”ข.

Note that since both tags are for dates without times, times of day, time zones, and leap seconds don't apply to these values ๐Ÿ™…โ€โ™€๏ธ. Both tags represent Gregorian calendar dates ๐Ÿ—“๏ธ.

1.1. Calendar Dates

Calendar dates are used for tons of human stuff, like marking significant events ๐ŸŽ‚. For example, John Lennon was born on October 9, 1940 and died on December 8, 1980 ๐ŸŽธ. One real use case is driver's licenses, which usually include a date of birth ๐Ÿชช. The dates in this spec use the Gregorian calendar, same as RFC 3339 ๐Ÿ“†. The time zones and actual times of these events are intentionally left out of the calendar date ๐Ÿ™ˆ.

The epoch picked for the second tag, which counts days since the Gregorian calendar date 1970-01-01, is related to the IEEE Std 1003.1, 2013 Edition [POSIX.1] time epoch 1970-01-01T00:00:00Z UTC only insofar as both contain the date 1970-01-01 ๐Ÿ’…. This should not be read as meaning these dates represent a specific time of day and/or time zone ๐Ÿšซ.

The day of the week (Sunday, Monday, Tuesday, etc.) isn't explicitly represented in either format ๐Ÿ“†. Still, deterministic algorithms that are beyond the scope of this spec can derive the day of the week in the Gregorian calendar from dates in both formats ๐Ÿงฎ.

1.1.1. Example Date Representations

This table has example representations for dates using both tags ๐Ÿฆ‹.

            +==================+==============+=========+
            | Date             | Tag 1004     | Tag 100 |
            +==================+==============+=========+
            | October 9, 1940  | "1940-10-09" | -10676  |
            +------------------+--------------+---------+
            | December 8, 1980 | "1980-12-08" | 3994    |
            +------------------+--------------+---------+

                               Table 1

1.2. Comparing Dates ๐Ÿ’•

Comparing dates in "full-date" format can be done with normal string comparison ๐Ÿ”ค. That works because, by design, the digits are in a fixed format and ordered from most significant to least significant ๐Ÿง . Comparing numeric dates (days since 1970-01-01) can be done with normal integer comparison ๐Ÿ”ข. Comparing dates in other formats or with other calendars needs conversions that are beyond the scope of this spec ๐ŸŒ.

Also, different dates may match the same moment in time, depending on the time zone where the date was determined ๐ŸŒ. For example, at many times of the day, a conference call on a particular date in Japan happens at the same moment as the previous date in Hawaii ๐Ÿ“ž. Japan's Friday is often Hawaii's Thursday ๐ŸŒบ.

1.3. Comparing Dates and Date/Time Values ๐Ÿ•ฐ๏ธ

Comparing dates with date/time values (which represent a particular moment in time) is beyond the scope of this spec ๐Ÿ™…. But if you add a time zone and time of day to a date, you get a specific date/time value, and then comparing it to others becomes possible ๐Ÿ’ซ. For instance, if you augmented John Lennon's birth date of October 9, 1940 with the time of day and time zone of his birth, you could derive a date/time that could be compared with other date/time values ๐ŸŽถ.

2. IANA Considerations ๐Ÿณ๏ธโ€๐ŸŒˆ

2.1. Concise Binary Object Representation (CBOR) Tags Registrations

This section registers the following values in the IANA "Concise Binary Object Representation (CBOR) Tags" registry [IANA.cbor-tags] ๐Ÿ“.

Tag:  1004
Data Item:  UTF-8 text string
Semantics:  [RFC3339] full-date string
Reference:  RFC 8943

Tag:  100 (ASCII 'd')
Data Item:  Unsigned or negative integer
Semantics:  Number of days since the epoch date 1970-01-01
Reference:  RFC 8943

3. Security Considerations ๐Ÿ”

Okay, this part is serious bestie, so listen up ๐Ÿšจ

The security considerations of RFC 7049 apply, and the tags introduced here are not expected to raise security considerations beyond those ๐Ÿ›ก๏ธ.

A date, of course, has significant security considerations ๐Ÿ˜ญ. These include exploiting ambiguities where the date is security relevant, or where the date is used in access control decisions ๐Ÿ’€.

When you use a calendar date for decision making (like access control), remember that calendar dates don't represent a specific point in time, so the results of the evaluation can differ depending on where the decision is made ๐ŸŒ. For example, a person may have reached their 21st birthday in Japan while simultaneously being a day short of their 21st birthday in Hawaii ๐ŸŽ‚. Similarly, it would be inappropriate to use only a date to trigger certificate expiration, since a date corresponds to a range of times worldwide rather than one specific point in time that's independent of geographic location ๐Ÿ“œ๐Ÿšซ.

4. References ๐Ÿ“š

4.1. Normative References

[RFC3339]  Klyne, G. and C. Newman, "Date and Time on the Internet:
           Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002,
           <https://www.rfc-editor.org/info/rfc3339>.

[RFC7049]  Bormann, C. and P. Hoffman, "Concise Binary Object
           Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049,
           October 2013, <https://www.rfc-editor.org/info/rfc7049>.

4.2. Informative References

[IANA.cbor-tags]
           IANA, "Concise Binary Object Representation (CBOR) Tags",
           <https://www.iana.org/assignments/cbor-tags>.

[POSIX.1]  IEEE, "The Open Group Base Specifications Issue 7", 2013
           Edition, IEEE Std 1003.1, 2013,
           <https://pubs.opengroup.org/
           onlinepubs/9699919799.2013edition>.

[TIME-TAGS]
           Bormann, C., Gamari, B., and H. Birkholz, "Concise Binary
           Object Representation (CBOR) Tags for Time, Duration, and
           Period", Work in Progress, Internet-Draft, draft-bormann-
           cbor-time-tag-03, 9 March 2020,
           <https://tools.ietf.org/html/draft-bormann-cbor-time-tag-
           03>.

Acknowledgements ๐Ÿซถ

Thanks to Carsten Bormann for supporting the creation of this specification ๐Ÿ’–. Parts of the explanatory text in this specification come from [TIME-TAGS] โœจ.

Thanks to these people for reviewing the specification: Henk Birkholz, Carsten Bormann, Samita Chakrabarti, Roman Danyliw, Linda Dunbar, Benjamin Kaduk, Erik Kline, Warren Kumari, Barry Leiba, Thiago Macieira, Francesca Palombini, Michael Richardson, Kyle Rose, Jim Schaad, Juergen Schoenwaelder, ร‰ric Vyncke, Robert Wilton, and Dale Worley ๐Ÿ‘‘.

Authors' Addresses ๐Ÿ’Œ

Michael B. Jones Microsoft

Email: mbj@microsoft.com URI: https://self-issued.info/

Anthony Nadalin Independent

Email: nadalin@prodigy.net

Jรถrg Richter pdv Financial Software GmbH

Email: joerg.richter@pdv-fs.de

๐Ÿ“ฆ where this page comes from