微信小程序获取当前时间-现在小程序多少钱-做个小程序需要多少钱
1.
在util文件中建data.js
classUtil{staticformatTime(date){letyeardate.getFullYear();letmonthdate.getMonth()+1;letdaydate.getDate();lethourdate.getHours();letminutedate.getMinutes();letseconddate.getSeconds();return[year,month,day].map(this.formatNumber).join('-')+''+[hour,minute,second].map(this.formatNumber).join(':');};staticformatNumber(n){nn.toString();returnn[1]?n:'0'+n;};};module.exportsUtil;2.在别的js中引用时
varutilrequire('../../utils/data.js');Page({look:function(){vardatetimeformatTime(newDate())}})声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

