onLoad: function () {
var a = newDate(), b = a.toLocaleString('chinese', { hour12: false })
console.log(a, b, String(a))
this.setData({
localTime: b
})
console.log(this.data.localTime)
}
转换为中国24小时制时间,zh-CN 或 chianese
// 2020/5/7 09:13:45
new Date().toLocaleString('zh-CN', { hour12: false })
new Date().toLocaleString('chianese', { hour12: false })
onLoad: function () { var a = new Date(), b = a.toLocaleString('chinese', { hour12: false }) console.log(a, b, String(a)) this.setData({ localTime: b }) console.log(this.data.localTime) }
转换为中国24小时制时间,zh-CN 或 chianese
// 2020/5/7 09:13:45
new Date().toLocaleString('zh-CN', { hour12: false })
new Date().toLocaleString('chianese', { hour12: false })
若认为该回答有用,给回答者点个[ 有用 ],让答案帮助更多的人
//a: <Date: 2020-05-07T01:42:28.967Z>
//String(a): Thu May 07 2020 09:42:28 GMT+0800 (CST)
云函数?