(function() {
	//创建补0函数
	function p(s) {
		return s < 10 ? '0' + s: s;
	}

	//创建、格式化时间函数
	var younger_time = function(time) {
		var time = new Date(time);
		var year = time.getFullYear();
		var month = time.getMonth() + 1;
		var day = time.getDate();

		//格式化时间
		var str = year + '-' + p(month) + '-' + p(day);

		//写入时间格式为 xxxx-xx-xx
		document.getElementById("div_ID").innerHTML = str;
	}

	//服务器时间(毫秒为单位)
	younger_time(ServerTime * 1000);
})()

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2021-09-15
相关资源
相似解决方案