1
我試圖讓TIMEAGO插件工作具有以下時間戳jQuery的TIMEAGO插件與unix時間戳工作
2017年3月16日18:37:20
然後我試圖將其轉換這個timestamp.but其仍然沒有工作
下面是代碼
<script src="jquery.timeago.js" type="text/javascript"></script>
<script src="jquery.min.js" type="text/javascript"></script>
<script src="jquery.livequery.min" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(".demo_class").timeago();
});
</script>
而且因爲我試圖做到這一點在表中。這裏是負責代碼
<td>
<?php
$datetime = $row['date'];
$datetime = strtotime($datetime);
?>
You opened this page <span class='demo_class' ><?php echo $datetime ; ?></span>
</td>
如果可能的話u能幫助我使代碼autoupdating?如時間,而無需刷新
自動改變TIMEAGO使用類似於這種
2008-07-17T09:24:17Z
jQuery的TIMEAGO的
您如何告訴我們timeago期待的格式?我們不會去閱讀它的文檔 – nogad
更新了這個問題。 –
您可以使用php'date()'或mysql'DATE_FORMAT()'格式化日期' – nogad