<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script> function f(){ let a=new Date() b=a.getFullYear(); c=a.getMonth()+1; d=a.getDay(); e=a.getHours(); g=a.getMinutes(); h=a.getSeconds(); i=b+"年"+c+"月"+d+"日"+e+"时"+g+"分"+h+"秒"; return i } document.write(f()); </script> </head> <body> </body> </html>