• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
阳光Angel
博客园    首页    新随笔    联系   管理    订阅  订阅
时间(遍历)

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>

<body>
<ul class="time">
 <!--秒杀开始时间戳--><li></li>
 <!--秒杀开始时间戳--><li></li>
 <!--秒杀开始时间戳--><li></li>
</ul>

 

<script src="js/jquery.1.11.js"></script>
<script>
$(document).ready(function(e) {
 var dat= new Date, year=dat.getFullYear(),month=dat.getMonth(),date=dat.getDate(),
 h=dat.getHours(),m=dat.getMinutes(),s=dat.getSeconds(),day=dat.getDate();
 //timestamp=Date.parse(date).toString().substr(0,10);//后台配合的时间戳
 $('.time li').each(function(index, element) {
  $(this).html(year+'年'+month+'月'+date+'日'+' '+h+'时'+m+'分'+s+'秒');
    });
});
</script>
</body>
</html>

posted on 2014-05-06 14:10  xiaoleilei  阅读(389)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3