谎伴

  • 首页
  • 关于作者
  • 文章归档
  • 友情链接
  • 留言反馈
  • RSS Feed
  • GitHub
  • WordPress

赞赏/打赏

站点监测

站点服务

HTML获取当前时间

  • 谎言相伴
  • 2020-05-09
  • 0

代码如下:

<SCRIPT language=JavaScript>
today = <strong>new</strong> <strong>Date</strong>();
<strong>var</strong> date;
<strong>var</strong> centry ;
centry="";
<strong>if</strong> (today.<strong>getFullYear</strong>()<2000 )
centry = "19" ;
date1 = centry + (today.<strong>getFullYear</strong>()) + "年" + (today.<strong>getMonth</strong>() + 1 ) + "月" + today.<strong>getDate</strong>() + "日 " ;
date2 = "";
document.<strong>write</strong>( date1+date2);
</SCRIPT>

可以把上述代码放到网页任何地方

© 2025 谎伴
Theme by Wing
  • {{ item.name }}
  • {{ item.name }}