阅读背景:

时间戳与日期的转化————小程序

来源:互联网 

时间戳与日期的转化————小程序

const app = getApp()
const now = new Date();
const month = now.getMonth() + 1 *//⽉份需要+1*
const day = now.getDate()

var timestamp = Date.parse(new Date());  
//把当前日期转化为时间戳数字
timestamp = timestamp / 1000;  
//得出具体当前时间的时间戳
console.log("当前时间戳为:" + timestamp);  

console.log("当前日期为:" + now);const app = getApp()
const no



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: