Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.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
Javascript “如何显示人类可读性”;“很久以前”;_Javascript_Jquery - Fatal编程技术网

Javascript “如何显示人类可读性”;“很久以前”;

Javascript “如何显示人类可读性”;“很久以前”;,javascript,jquery,Javascript,Jquery,我的用户上次登录是在2012年1月25日星期三15:50:09 我如何将其显示为“10分钟前”。 有js吗?我一直在使用,它是一个jQuery插件,非常容易使用。主页中的示例是自我解释的: <script src="jquery.timeago.js" type="text/javascript"></script> $("abbr.timeago").timeago(); $(“缩写为timeago”).timeago(); 将转换此标记: <abbr cl

我的用户上次登录是在2012年1月25日星期三15:50:09 我如何将其显示为“10分钟前”。 有js吗?

我一直在使用,它是一个jQuery插件,非常容易使用。主页中的示例是自我解释的:

<script src="jquery.timeago.js" type="text/javascript"></script>
$("abbr.timeago").timeago();

$(“缩写为timeago”).timeago();
将转换此标记:

<abbr class="timeago" title="2008-07-17T09:24:17Z">July 17, 2008</abbr>
,特别是如果您想将日期转换为可读格式的时间戳,但在您的情况下,我认为您并不真正需要它

<abbr class="timeago" title="July 17, 2008">3 years ago</abbr>