how does js calculate how many minutes have elapsed from one time to another
for example,
var maxtime ="2018-07-04 13:42:00";
var mintime = "2018-07-04 00:00:00";
how many minutes are there between maxtime and mintime?
how does js calculate how many minutes have elapsed from one time to another
for example,
var maxtime ="2018-07-04 13:42:00";
var mintime = "2018-07-04 00:00:00";
how many minutes are there between maxtime and mintime?
two ways of thinking:
1 counts as a difference of several hours, minutes and seconds
2: all convert to s and then subtract.
the actual development of the project is recommended to adopt moment.js
< hr >it's not easy to answer. Remember to adopt
if you think it's useful.var maxtime ="2018-07-04 13:42:00";
var mintime = "2018-07-04 00:00:00";
//
var b = Date.parse(mintime);
var e = Date.parse(maxtime);
//
var minutes = Math.round((e - b) / 60 / 1000);
//
var ms = new Date(maxtime).getTime()-new Date(mintime).getTime()
//
var minute = ms/1000/60
//DATE()100060000
var d1 = new Date('2016/03/28 10:17:22');
var d2 = new Date('2016/03/28 11:17:22');
console.log(parseInt(d2 - d1));//
console.log(parseInt(d2 - d1) / 1000);//
console.log(parseInt(d2 - d1) / 6000 );//
console.log(parseInt(d2 - d1) / 3600000 );//
Previous: Can the component corresponding to the route requested by the vue backend take effect?
Next: Page code prompts error Uncaught SyntaxError: Unexpected identifier
do the gods have plug-ins for uploading attachments in the mobile version that can also be uploaded more than one? ...
the traditional position: fixed; is relative to the window, and there are two main points of the problem . relative to the specified parent element fixed positioning encountered the following problems in mobile development. The green box is the...
better-scroll, can be delimited infinitely, how to solve this bug ...
how can the data looped out by vue change color to the current one when clicked? this is what my page says <ol v-if="tooglezhi" class="ol_one"> <li v-for="(item,key) in arr" ...
the number of digits in the input box is controlled. When this value echoes the maximum number of digits, the input can only be deleted and the input cannot be overridden directly. who knows what attributes the input has to control this ...
Baidu didn t find the reason for it for a while-the error message thrown by the browser was Uncaught Error: Objects are not valid as a React child (found: object with keys {}). If you meant to render a collection of children, use an array instead or wr...
< html > <ion-list> <ion-item *ngFor= let i of list >< ion-item> < ion-list> < html > how do I listen to whether ngFof has finished traversing this array? ...
as shown in the figure, there are four sort buttons in a table header, and the requirements are as follows: the first click on descending order, the second click on ascending order, and the third click on the default display (no sorting); I would li...
shouldn t vue use vue-router? Why can it only be put into devDependencies (development dependency)? ...
<el-select @change="orgChange" v-model="sectionNameOpt" filterable placeholder=""> <el-option v-for="item in sectionNameOpts" :key="item.index" :label="item.orgN...
the XMLHttpRequest that requests the interface to keep reporting url (interface) under IE edge ie10 requires cross-domain resource sharing CORS, but the data is all back. Other browsers are fine, the background should have done cors processing, why? ...
how to set path to window.loaction.host with jquery.cookie.js under IE cannot be saved, how to set path ...
question, as shown in figure the html code is as follows: <span class="button"><input type="file" id="file" name="file" onchange="this.parentNode.nextSibling.value = this.value">< sp...
I have two elements, a parent element and a child element. the parent element rotates N degrees. then I want to move the positioning of the child element, which moves relative to the parent element. how do I calculate the offset value. Let it move re...
I just want to install jquery, with yarn. Why do I install so many other things? ...
directly above the picture, how to take this top value ...
as shown in the figure, v-for generates input, in Vue. When the add button is clicked, the cursor automatically focuses on the latest input, window and automatically moves to the appropriate location! ...
problem: the IOS system entered the page for the first time and added if (navigator.geolocation) {}, but did not execute navigator.geolocation.getCurrentPosition (this.showPosition.bind (this), this.showError.bind (this), options); did not enter showPo...
found a JS scheme that uses canvas to generate thumbnails on the Internet, which can generate thumbnails, but in some cases, the generated thumbnails are black and you can t see what the original thumbnails look like. Because the previous paragraph is ...
...