源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>享学课堂</title> </head> <body> <p>toUTCString() 方法将日期UTC时间字符串 (日期显示标准).</p> <p id="demo"></p> <script> var d = new Date(); document.getElementById("demo").innerHTML = d.toUTCString(); </script> </body> </html>
运行结果