天天看点

获取当前时间(时间戳)

前言:

效果:

获取当前时间(时间戳)
<!DOCTYPE html>
<html >

	<head>
		<meta charset="UTF-8" />
		<title>Document</title>
	</head>
		
	<body>
		<script>
			function formatDate() {
				now = new Date().getTime();
				return now
			}
			console.log(formatDate());//当前时间戳
		</script>
	</body>

</html>
           

继续阅读