------------只要够努力,人生最坏的结局不过是大器晚成!!!

  js里面要用可以用伊尔表达式,循环是用js:

document.getElementById("${pj.pltime }").innerHTML = dateToGMT("${pj.pltime }");

        <div class="order-info">
		<p id="${pj.pltime}">
			<script type="text/javascript">
				function dateToGMT(strDate) {
					console.log("原始时间格式:" + strDate);
					var date = new Date(strDate);
					var y = date.getFullYear();
					var m = date.getMonth() + 1;
					m = m < 10 ? ('0' + m) : m;
					var d = date.getDate();
					d = d < 10 ? ('0' + d) : d;
					var h = date.getHours();
					var minute = date.getMinutes();
					minute = minute < 10 ? ('0' + minute) : minute;
					var str = y + "-" + m + "-" + d + " " + h + ":" + minute;
					console.log("转换时间格式:" + str);
					return "评论时间:" + str;
				}
				document.getElementById("${pj.pltime }").innerHTML = dateToGMT("${pj.pltime }");
			</script>
		</p>

	</div>    

  

posted on 2019-01-01 20:15  ystraw  阅读(459)  评论(0编辑  收藏  举报

不经一番切孤寒,怎得梅花扑鼻香