TAP datetime
From Test Anything Protocol
There are many, many, many date and time formats out there with various levels of accuracy, readability and parsability. To promote the use of a human-readable, machine parsable and unambiguous date time format, TAP output may follow the following standard for dates and times.
Contents |
[edit] Status
This is a TAP proposal and has not been accepted.
[edit] For
- Brobinson9999 18:19, 2 April 2010 (BST)
- Schwern 23:15, 4 September 2007 (BST)
- AndyArmstrong 23:20, 4 September 2007 (BST)
- Adrianh 16:51, 9 September 2007 (BST)
[edit] Against
[edit] Usage
Date formatting is a particularly common and contentious issue with so many formats to choose from and many layers of precision within each. This proposal establishes a baseline date format for TAP producers. It is encouraged that dates emitted in TAP diagnostics will use this format to help with parsability, readability, disambiguation and interoperability.
That a given TAP field contains a TAP datetime should be worked out between the parties. This may be addressed in a future version.
On the other hand, the TAP metadata information must use this format.
[edit] Grammar
The TAP datetime is effectively RFC 3339. It remains a subset of ISO 8601 2004.
tap_datetime = rfc_3339_date " " rfc_3339_time |
rfc_3339_date |
rfc_3339_time |
rfc_3339_datetime
rfc_3339_date = As RFC 3339 section 5.6 "full-date"
rfc_3339_time = As RFC 3339 section 5.6 "full-time"
rfc_3339_datetime = As RFC 3339 section 5.6 "date-time"
[edit] Differences from RFC 3339
- It is encouraged, for human readability, that applications drop the "T" separating date and time.
- TAP datetime allows just a date or just a time.
[edit] Examples
These examples use the preferred space separated format with time zone.
2007-09-01 07:09:01Z (Sept 1st, 2007, 07:09:01 UTC) 2007-09-01 00:09:01-07 (Sept 1st, 2007, 00:09:01 PDT)
Here's an example of an rfc_3339_time with time zone information.
00:09-07 (00:09 PDT)
This is an rfc_3339_datetime.
2007-09-01T07:09:01Z (Sept 1st, 2007, 07:09:01 UTC)
Here's an example of using the TAP datetime in a TAP diagnostic
not ok 1 - date of the par-tay
---
found: 2007-09-01
wanted: 2007-09-02
...

