Is it valid to use time stamp instead normal date format in meta tags?

浪子不回头ぞ 提交于 2019-12-12 12:25:57

问题


Is it valid to use time stamp instead normal date format in meta tags?

for example:

<meta name="revised" content="Wednesday, September 24, 2014, 2:51 pm" />

to

<meta name="revised" content="1431475718" />

or for

<META NAME="Expires" CONTENT="1431475718">

回答1:


You may not use revised or expires in HTML5, as these metadata names are neither defined in the spec nor registered on MetaExtensions.

No one tried to register revised. Someone tried to register expires, but a spec was missing, so it was not approved.

So …

  • without specifications for these metadata names, authors don’t know when and how to use it, and consumers don’t know how to interpret it.

  • if there are specifications, these metadata names could be registered on MetaExtensions, and it would be clear which format the value must have.




回答2:


From my research, [1] [2], it seems that there isn't a mandated format, however it is recommended to use ISO 8601.

Date may be used to express temporal information at any level of granularity. Recommended best practice is to use an encoding scheme, such as the W3CDTF profile of ISO 8601 [W3CDTF].

Google also recommends following this format. You could use a timestamps and some crawlers will try to handle them (like Google), you would be better off following ISO 8601 (2015-05-03T15:38:45+00:00).



来源:https://stackoverflow.com/questions/30203478/is-it-valid-to-use-time-stamp-instead-normal-date-format-in-meta-tags

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!