您好,欢迎来到外链网!
当前位置:外链网 » 站长资讯 » 专业问答 » 文章详细 订阅RssFeed

java时间戳转标准时间,orclesql时间戳转换标准时间

来源:互联网 浏览:83次 时间:2023-04-08
function timeFilter (time = +new Date()) { const date = new Date(time + 8 * 3600 * 1000); return date.toJSON().substr(0, 19).replace('T', ' ');}

方法使用

直接调用方法 timeFilter()不传参,则直接返回当前时间

调用方法并传入时间戳 timeFilter(1606892418855),则直接返回对应时间戳的时间。

顺便提一下获取当前时间的时间戳的方法:new Date().getTime()