Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Date 在<;时间>;标签';现在';_Date_Time_Microformats_Html - Fatal编程技术网

Date 在<;时间>;标签';现在';

Date 在<;时间>;标签';现在';,date,time,microformats,html,Date,Time,Microformats,Html,我正在使用时间标记来定义时间,这似乎是正确的方法;-) 然而,我的问题是我想在时间标签中放置的值是:现在。我收到以下验证错误: The text content of element time was not in the required format: The literal did not satisfy the time-datetime format." 从规范来看,似乎不可能定义“现在”。真讨厌。有什么办法吗?你不能。HTML5中的标记定义为特定时刻、时段或持续时间或时间偏移的标记

我正在使用时间标记来定义时间,这似乎是正确的方法;-)

然而,我的问题是我想在时间标签中放置的值是:现在。我收到以下验证错误:

The text content of element time was not in the required format:
The literal did not satisfy the time-datetime format."
从规范来看,似乎不可能定义“现在”。真讨厌。有什么办法吗?

你不能。HTML5中的标记定义为特定时刻、时段或持续时间或时间偏移的标记,而不是所有与时间相关的概念


例如,您可以编写
now
,从而将固定时间与文本内容“now”关联起来。我看不出这有什么用处,
time
元素的有用性一般来说是值得怀疑的(它看起来像是为了标记而标记的),但是像这样的事情是“定义‘现在’”所能做的一切。
time

我现在使用这个标记:

<time datetime="2013">Present</time>
存在

没有更多的错误,它是符号化的。遗憾的是,目前还没有被接受的变量。

这个用例是什么?好问题;用例上下文是项目和经验的简历列表。但我也希望它是机器可读的。重复的(无耻的插件:我自己的问题:)我认为它可能非常有用,例如,在堆栈溢出上,它说这个答案“4小时前回答”。现在,“4小时前”可以标记为
time
元素,包含发布时间。如果有人对页面进行归档,这样的相对时间参考是没有用的,但是由于
time
的缘故,可以以正式的方式包含日期。