首页 > 编程知识 正文

js获取当前系统时间年月日,js获取当前时间年月日并输出

时间:2023-05-04 23:16:27 阅读:16614 作者:2884

获取当前的hxdnht

//是否要获取当前hxdnhtletdate=new date (lety=date.getfullyear ) (let M=date.getMonth ) (1) 10? '0'(date.getmonth(1) : ) date.getmonth) let D=date.getDate ) ) 10? (0)0' date.getDate () : date.getDate ) ) let hours=date.getHours ) ) let minutes=date.getMinutes ) ) 10? (0)0' date.getMinutes () : date.getMinutes ) ) let seconds=date.getSeconds ) ) 10? (0)0' date.getSeconds () : date.getSeconds ) ) date=y '-' m '-' d ' hours ' : ' minutes ' 3360 '

let my date=new date (const lw=new date ) mydate-1000*60*60*24*90 ) /最后数字90可以更改。 90天的含义const YY=lw.getfullyear (const mm=lw.getmonth ) )1const DD=lw.getdate (const hh=new date ).getHours )。 '0'newdate(.getMinutes ) ) : new date (.get minutes ) ) const ss=new date (.get seconds ) ) 10? '0'newdate(.getSeconds ) ) : new date (.get seconds ) ) conststartdate=YY'-' ) M10? '0'mm:mm(-) ) DD10? '0' dd : dd ),' hh ':' mf ':' ss//上一个日期

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。