作者:zccst
官方网站:http://timeago.yarp.com/
<script type="text/javascript" src="jquery-1.7.1.js"></script>
<script type="text/javascript" src="jquery.timeago.js"></script>
<script type="text/javascript" src="timeago.ch.js"></script>
<title>时间格式化</title>
<style type="text/css">
.a{ width:200px; height:100px; background-color:#FC9}
</style>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("abbr.timeago").timeago();
//jQuery("div.timeago").timeago();
});
</script>
</head>
<div class="a timeago"></div>
<abbr class="timeago" title="2012-03-01 14:16:35"></abbr>
<abbr class="timeago" title="2012-03-09 14:16:35"></abbr>
官方网站:http://timeago.yarp.com/