WeChat applet--Get the current time

get current time

1. First, you need to load the util.js file in the .js file that gets the current time

var util = require('../../utils/util.js');

2. We can see that the method of obtaining time has been written in the util.js file, just import it directly into the required .js file

insert image description here

3. Use the onLoad method to call the formatTime method in util.jsinsert image description here

Among them, formatTime() needs to pass in the parameter new Data(),
so that the current time of the system can be obtained.

An important message is inserted here! ! !
If you like cold knowledge,
eager to explore the magical world, and
want to be an all-knowing academic master,
come and follow us.
insert image description here

Supongo que te gusta

Origin blog.csdn.net/CrazyQiQi/article/details/88419256
Recomendado
Clasificación