116

I was wondering why all browsers, like Chrome versions higher than 26, which had support in the past for the input datetime removed it?

This sounds like a duplicate of this article, but that one is quite aged.

It looks like the HTML WG prefers datetime-local (w3c) above datetime (w3c), but why?

See this for feature development timeline.

What others say:

According to mobilexweb.com it was deprecated in iOS 'because it looks too much like the datetime input type'.

Following Google Chrome, now Safari on iOS doesn’t support the datetime input type anymore and it will fallback to text. This type was deprecated in the standard in favor of datetime-local or using two inputs, date and time for the same purpose. The problem is that datetime was compatible with iOS from version 5.0 to 6.1; if you are using it, be careful!

What is the difference?

Where datetime-local contains only a date and time element, datetime also contains the time zone. This is useful since you might want to act differently when the client's time zone is different from the server's one.

Why does this matter?

What if the web page asks: when do you want me to call you, and the user selects 'tomorrow, 3pm', when do you need to call him back? tomorrow 3pm UTC or CET?

4

2 回答 2

69

我能想到的唯一原因是浏览器供应商对被批准的标准失去信心,因此从他们的代码中删除了实现。

为了支持这个想法:W3C 刚刚从他们的工作草案中删除了datetime两者datetime-local

浏览器供应商最终将放弃对它们的支持。

根据html5test,当前大多数浏览器都删除了对这两种输入类型的支持。

最新进展:

  • 回到datetime-local草稿;
  • 较新的规格页面不显示datetime,但确实显示datetime-local。听起来它确实回到了地图上并且将再次得到支持!

还要注意 Webmasters.SE 上的相关帖子:是否从 HTML 5.1 中删除了 datetime-local?.

于 2014-01-21T16:40:13.553 回答
9

来源http://www.w3.org/TR/html5/

“以下功能存在风险,可能由于缺乏实施而被删除
。..<input type=datetime>..”

于 2014-01-22T18:29:16.737 回答