var myDate = new Date();
myDate.getHours(); //获取当前小时数(0-23)
你要的格式自己去格式化。。。
时间.rar
https://blog.csdn.net/weekdawn/article/details/103772443