微信小程序 - 时间戳转时间

获取当前时间:十位unix时间戳

var timestamps = Math.round(new Date().getTime() / 1000).toString();

 

 

时间戳转时间(官方自带)

 

使用实例:

var time = "1531791600";

app.util.formatTime(time);

 

posted @ 2018-07-16 12:49  Sunsin  阅读(3439)  评论(0编辑  收藏  举报