PHP(函数)
<script>
// 获得日
var time = new Date();
var x = time.getDate();
document.write(x+"日,");
// 获得当前小时
var b = new Date();
var y = time.getHours();
document.write(y+"点,");
// 获取分钟
var c = new Date();
var v = time.getMinutes();
document.write(v+"分,");
// 获取时间戳
var t = new Date();
var w = time.getTime();
document.write(w+"时间戳,");
// 获得年份
var e = new Date();
var q = time.getFullYear();
document.write(q+"年,");
// 获取月份
var g = new Date();
var a = time.getMonth()+1;
document.write(a+"月,");
// 获取秒
var b = new Date();
var m = b.getSeconds();
document.write(m+"秒,");
// 获取毫秒
var l = new Date();
var p = l.getMilliseconds();
document.write(p+"毫秒,");
// 获得星期几
var xing = new Date();
var ji = xing.getDay();
document.write("星期"+ji+",");
// 获得完整日期
var riqi = new Date();
var wanzheng =Date();
document.write("完整时间:"+wanzheng+",");
</script>