Timeago + Localtime合计 [英] Timeago + Localtime combined

查看:116
本文介绍了Timeago + Localtime合计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试合并 timeago datejs 在此帮助下获取当地时间格式

I'm trying to combine timeago with datejs (with help of this to get format for local time)

timeago 我使用以下内容:

jQuery(document).ready(function() {
  jQuery("abbr.timeago").timeago();
});

对于 localtime 我使用:

jQuery(document).ready(function() {
    $('.UTCTimestamp').localTimeFromUTC('MM/dd/yyyy hh:mm:ss');
});

如何将这两者结合在一起?现在我只能在这个时候使用一个:

How do I combine those two together? Right now I'm only able to use one at the time like this:

对于Timeago:

<span class='UTCTimestamp'>2011-09-09 10:10:10</span>

和本地时间;

<abbr class='timeago' title='2011-09-09 10:10:10'>2011-09-09 10:10:10</abbr>


推荐答案

不添加任何javascript代码或jquery代码,除非这个;

don't add any javascript code or jquery code except this;

$('.timeago').timeago();

然后添加'Z'(或包括T)。欲了解更多信息,请访问链接

and then add 'Z' (or including T). for more information go to this link

<abbr class='timeago' title='2011-09-09 10:10:10Z'></abbr>

http://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations

这篇关于Timeago + Localtime合计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆