获取当前时间 1.首先需要在获取当前时间的.js文件当中载入util.js文件 var util = require('../../utils/util.js'); 2.我们可以看到util.js文件当中已经写好了获取时间的方法,直接在所需.js文件中引入就好 3.用onLoad方法,调用util.js中的formatTime方法 其中formatTime() 需要传入参数new Data(), 这样就获取到了系统的当前时间。 相关文章: 2021-08-26 2021-05-14 2021-12-12 2021-12-02 2021-12-20 2021-11-21 2021-12-12