Some questions about the UTC and ISO 8601 time formats

Source: Internet
Author: User
Tags time zones iso 8601
Strictly speaking, this title may not be correct, because I first niang a bit, ISO8601 time format standard should resemble: 2016-01-18t23:41:00-08:00, and UTC time format is almost similar

In doing a project using a foreign API, the return time format is:2016-01-18t23:41:00

I have a few questions to ask:
1. Because there is no specific data to search, the 2016-01-18t23:41:00 returned is the UTC time and the ISO-8601 time format?
2. As above, if this is the ISO time format, because there is no time zone specified, then the default is +00:00 like "2016-01-18t23:41:00"? (if it is a UTC time, it is similar to the problem, no time zone/slack is specified what the default is, if any)

Reply content:

Strictly speaking, this title may not be correct, because I first niang a bit, ISO8601 time format standard should resemble: 2016-01-18t23:41:00-08:00, and UTC time format is almost similar

In doing a project using a foreign API, the return time format is:2016-01-18t23:41:00

I have a few questions to ask:
1. Because there is no specific data to search, the 2016-01-18t23:41:00 returned is the UTC time and the ISO-8601 time format?
2. As above, if this is the ISO time format, because there is no time zone specified, then the default is +00:00 like "2016-01-18t23:41:00"? (if it is a UTC time, it is similar to the problem, no time zone/slack is specified what the default is, if any)

UTC is the time standard; ISO-8601 is a standard format for representing time, and most programming languages support it.

    1. 2016-01-18t23:41:00 is a time representation that complies with the ISO-8601 standard.

    2. The T in the 2016-01-18t23:41:00 represents UTC, so this string resolves to the UTC time of 2016-01-18 23:41:00, then converted to Beijing local time display (for example, in JavaScript, the new date (' 201 6-01-18t23:41:00 ') (toLocaleString ()) is added with a 8-hour offset, which becomes: 2016-01-19 7:41:00.

More of this stuff, you can refer to the article I wrote earlier: http://segmentfault.com/a/1190000004292140

First you are confused about these two concepts, UTC is time, not the format of time, and ISO-8601 cannot be compared.

Then answer your question,
IOS-8601 does not have a single format, but contains many formats, where there is no time zone for the 0 time zone. Of course, there is no time in other formats but only dates.

Attach a copy of the IOS-8601 official code
Http://www.iso.org/iso/home/standards/iso8601.htm

Wikipedia:
Time zones in ISO 8601 is represented as local time (with the location unspecified), as UTC, or as a offset from UTC.

If No UTC relation information is given with a time representation, the time was assumed to being in local time.
Therefore, if you do not specify a time zone, the local time is indicated. Equivalent to the time LocalTime received. The time zone does not specify a UTC time, and the UTC time must last indicate Z or an offset of +00.
The meaning of the T is only the delimiter, no other meaning.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.