Hello! It's a great pleasure to have you visit my blog.
It's truly a fateful encounter. If you are interested in Chinese goods, we can collaborate.
I can provide you with affordable Chinese products that you can sell in your country, thereby boosting our economic income.


If you are willing to cooperate, I hope to hear from you to discuss the opportunity for collaboration.
Here is my Email: t@29ym.com
Looking forward to connecting with you and embarking on this partnership together!

Js不同时间段运行不同代码

开发时经常会遇到根据不同的时间节点运行不同的代码,这样可以程序自动执行,而不需要到时候自己去修改。
比如,五点运行代码A,六点运行代码B

var date=new Date();//获取时间
var hour=date.getHours();//获取当前小时
if(hour>=0&&hour<12)//大于等于0点,小于12点执行代码A
 {
  console.log('执行代码A');
  }else{//其他时间节点执行代码B
  console.log('执行代码B'); 
  }
发表新评论