人生若只如初见

JS 时间戳转换时间,及时间转换

电脑版发表于:2020/3/27 11:58


前端有时候拿到数据库的时间有时候会是这个样子的   2020-03-03 T 08:05


大家一般都是用截取但是,这样有时候会很麻烦,然后写一个通用类


时间戳一般是十三位 



使用方式



时间戳需要转时间


new Date(parseInt(Timestamp)


formatDate(new Date(parseInt(value)), "yyyy-MM-dd HH:mm:ss")


不是时间搓直接传入就OK了




关于TNBLOG
TNBLOG,技术分享。技术交流:群号677373950
ICP备案 :渝ICP备18016597号-1
App store Android
精彩评论
{{item.replyName}}
{{item.content}}
{{item.time}}
{{subpj.replyName}}
@{{subpj.beReplyName}}{{subpj.content}}
{{subpj.time}}
猜你喜欢