hc学习平台

 找回密码
 立即注册
搜索
热搜: 活动 交友 javakc
 › 1337735459 › 日志

编写一个javascript函数,实时显示当前时间,格式“年-月-日 时:分:秒”  

2022-10-21 16:10:13 查看(86) 回复(0)

<!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>

评论 (0 个评论)

facelist

全部作者的其他最新日志



站点统计|举报|Archiver|手机版|小黑屋|Comsenz Inc.

GMT+8, , Processed in 0.195171 second(s), 9 queries .

Powered by javakc! X1.0

© 2004-2014 javakc

f1208.com 备案号:京ICP备14030918号-1

返回顶部