Time date format - W3C

xiaoxiao2021-03-06  166

Note-DateTime

Date and Time Formats

Submitted to W3C 15 September 1997

This version:

http://www.w3.org/TR/1998/Note-Datetime-19980827

NEWEST VERSION:

http://www.w3.org/tr/note-datetime

Authors:

Misha Wolf <

Misha.wolf@reuters.com>

Charles wicksteed <

Charles.wicksteed@reuters.com>

Document Status

Status of this document

This document is a NOTE made available by the W3 Consortium for discussion only. This indicates no endorsement of its content, nor that the Consortium has, is, or will be allocating any resources to the issues addressed by the NOTE.

This document is a submission to w3c from reuters limited. Please see acknowledged Submissions to w3c regarding its disposition.

Comments on this document should be sample to datetime-comments@w3.org.

Abstract

This document defines a profile of ISO 8601, the International Standard for the representation of dates and times. ISO 8601 describes a large number of date / time formats. To reduce the scope for error and the complexity of software, it is useful to restrict the Supported formats to a small number. this profile defines a few date / time formats, likely to satisfy MOST Requirements.

Introduction

The International Standard for the representation of dates and times is ISO 8601. Its full reference number is ISO 8601:. 1988 (E), and its title is "Data elements and interchange formats - Information interchange - Representation of dates and times" A discussion Of ISO 8601 HAS BEEN WRITTEN BY MARKUS KUHN.

ISO 8601 describes a large number of date / time formats. For example it defines Basic Format, without punctuation, and Extended Format, with punctuation, and it allows elements to be omitted. This profile defines a restricted range of formats, all of which are valid ISO 8601 dates and times. The aim is to simplify the use of ISO 8601 in World Wide Web-related standards, and to avoid the need for the developers and users of these standards to obtain copies of ISO 8601 itself.A particular problem with ISO 8601 is that it allows the century to be omitted from years, which is likely to cause trouble as we approach the year 2000. This profile avoids the problem by expressing the year as four digits in all cases.

This profile may be adopted by standards which require an unambiguous representation of dates and times. As different standards have their own requirements regarding granularity and flexibility, this profile offers a number of options. An adopting standard must specify which of these options it permits.

Formats

Different standards may need different levels of granularity in the date and time, so this profile defines six levels. Standards that reference this profile should specify one or more of these granularities. If a given standard allows more than one granularity, it should specify the meaning Of the dates and times with reduced precision, for example, The Result of Comparing Two dates with diffisions.

The formats are as follows. Exactly the components shown here must be present, with exactly this punctuation. Note that the "T" appears literally in the string, to indicate the beginning of the time element, as specified in ISO 8601.

Year:

YYYY (EG 1997)

Year and month:

YYYY-MM (EG 1997-07)

Complete Date:

YYYY-MM-DD (EG 1997-07-16)

Complete Date Plus Hours and Minutes:

YYYY-MM-DDTHH: MMTZD (EG 1997-07-16T19: 20 01: 00)

Complete Date Plus Hours, Minutes and Seconds:

YYYY-MM-DDTHH: MM: SSTZD (EG 1997-07-16T19: 20: 30 01: 00)

Complete Date Plus Hours, Minutes, Seconds and A Decimal Fraction of A

SECOND

YYYY-MM-DDTHH: MM: SS.STZD (EG 1997-07-16T19: 20: 30.45 01: 00)

WHERE:

YYYY = Four-Digit Year

Mm = two-digit month (01 = january, etc.)

DD = Two-Digit Day of Month (01 THROUGH 31)

HH = Two Digits of Hour (00 Through 23) (AM / PM Not ALLOWED)

MM = Two Digits of Minute (00 Through 59)

SS = Two Digits of Second (00 Through 59)

s = one or more digits representing a decimal fraction of a second

TZD = Time Zone Designator (z OR HH: mm or -hh: mm)

This profile does not specify how many digits may be used to represent the decimal fraction of a second. An adopting standard that permits fractions of a second must specify both the minimum number of digits (a number greater than or equal to one) and the maximum Number of Digits (The Maximum May Be Stated to Be "Unlimited").

This Profile Defines Two Ways of Handling Time Zone Offsets:

Times are expressed in UTC (Coordinated Universal Time), with a special UTC designator ( "Z") Times are expressed in local time, together with a time zone offset in hours and minutes A time zone offset of " hh:.. Mm "INDICES THAT THE / TIME USES A LOCAL TIME ZONE WHICH IS" HH "Hours and" mm "minutes ahead of utc. a time zone offset of" -hh: mm "INDICES That the date / time uses a local time zone Which IS "HH" Hours and "mm" minutes behind UTC.

A Standard Referencing this profile sale permit One or Both of these Ways of Handling Time Zone Offsets.examples

1994-11-05T08: 15: 30-05: 00 Corresponds to November 5, 1994, 8:15:30 AM, US Eastern Standard Time.

1994-11-05T13: 15: 30Z Corresponds to the Same Instant.

Acknowledgments

Document Draws On Chris Newman's Internet Draft "DRAFT-NEWMAN-dateTime-01.txt).

转载请注明原文地址:https://www.9cbs.com/read-128399.html

New Post(0)