比如:转换成 yyyy-mm-dd hh:mm:ss
//时间戳转换方法 date:时间戳数字 function formatdate(date) { var date = new date(date); var yy = date.getfullyear() + '-'; var mm = (date.getmonth() + 1 < 10 ? '0' + (date.getmonth() + 1) : date.getmonth() + 1) + '-'; var dd = (date.getdate() < 10 ? '0' + (date.getdate()) : date.getdate()); var hh = (date.gethours() < 10 ? '0' + date.gethours() : date.gethours()) + ':'; var mm = (date.getminutes() < 10 ? '0' + date.getminutes() : date.getminutes()) + ':'; var ss = (date.getseconds() < 10 ? '0' + date.getseconds() : date.getseconds()); return yy + mm + dd +" "+hh + mm + ss; }
如对本文有疑问, 点击进行留言回复!!
20200716——gitlab实操记录/精通git阅读笔记/prop
JQuery DataTables根据行数据不同而行或列的更改颜色
VScode中的react自动补全标签代码及黄色or红色警告
关于React处理input的方法和多个input共用一个方法(不用jQuery)
网友评论