Some Questions about UTC and ISO8601 time formats

Source: Internet
Author: User
Tags time zones iso 8601
Strictly speaking, this title may not be correct, because I first tried it. The ISO8601 time format standard should be similar to: 2016-01-18T23: 41: 00-08:00, the UTC time format is similar to using a foreign API for a project. The returned time format is: 2016-0... strictly speaking, this title may not be correct, because I first tried it. The ISO8601 time format standard should be similar to: 2016-01-18T23: 41: 00-08:00, while the UTC time format is similar.

When a project uses a foreign API, the returned time format is:2016-01-18T23: 41: 00

I have a few questions to ask:
1. Because no specific information is found, the returned 2016-01-18T23: 41: 00 is UTC time and is ISO-8601 time format?
2. As shown above, if this is an ISO time format, because no time zone is specified, will it be + by default, like "2016-01-18T23: 41: 00? (If it is UTC time, it is also a similar problem. The default time zone/time difference is not specified, if any)

Reply content:

Strictly speaking, this title may not be correct, because I first tried it. The ISO8601 time format standard should be similar to: 2016-01-18T23: 41: 00-08:00, while the UTC time format is similar.

When a project uses a foreign API, the returned time format is:2016-01-18T23: 41: 00

I have a few questions to ask:
1. Because no specific information is found, the returned 2016-01-18T23: 41: 00 is UTC time and is ISO-8601 time format?
2. As shown above, if this is an ISO time format, because no time zone is specified, will it be + by default, like "2016-01-18T23: 41: 00? (If it is UTC time, it is also a similar problem. The default time zone/time difference is not specified, if any)

UTC is the time standard; ISO-8601 is a standard format that represents time, which is supported by most programming languages.

  1. 2016-01-18T23: 41: 00 is a time representation that complies with ISO-8601 standards.

  2. T in 2016-01-18T23: 41: 00 represents UTC, so the string is parsed to indicate 23:41:00 of UTC time, then converted to Beijing Local Time Display (for example, in JavaScript, new Date ('2017-01-18T23: 41: 00 '). when toLocaleString () is added, the 8-hour offset is changed to 7:41:00.

For more information on this, refer to my previous article: http://segmentfault.com/a/1190000004292140

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

Answer your question later,
The IOS-8601 contains a lot of formats, and there is no time zone of 0. Of course, other formats do not have time only for date.

Appendix A IOS-8601 official Specification
Http://www.iso.org/iso/home/standards/iso8601.htm

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

If no UTC relation information is given with a time representation, the time is assumed to be in local time.
Therefore, if no time zone is specified, local time is used. It is equivalent to the time obtained by localtime. If the time zone is not specified, it does not represent UTC time. The UTC time must end with the offset Z or + 00.
The meaning of T is only a separator, which has 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.