💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
``` let d1 = new Date() let year = d1.getFullYear(); let mon = d1.getMonth(); let day = d1.getDate(); let hour = d1.getHours(); //得到小时数 let minute = d1.getMinutes() ; //得到分钟数 let second = d1.getSeconds(); //得到秒数 let date = year + "-" + (mon < 10 ? "0" + (mon+1) : mon ) + "-" + (day < 10 ? "0" + day : day ); let time = (hour < 10 ? "0" + hour :hour) + ":" + (minute < 10 ? "0" + minute : minute ) + ":" + (second < 10 ? "0" + second : second ); // 设置日期、时间 this.setData({"node2Date" : date,"node2Time" : time,}); ```