Something I must be doing wrong because when I add 5 minutes to the time I just got a result that is not in minutes comes out.
I have the following function in javascript
and jquery
that I am running with tampermonkey
:
// ==UserScript==
// @name Time Session Intranet
// @namespace nnn
// @version 1.0
// @description nnn
// @author nnn
// @match nnn/*
// @require https://code.jquery.com/jquery-3.3.1.min.js
// @grant none
// ==/UserScript==
var $ = window.jQuery;
$(function() {
$("#usuario").append(contador());
});
function contador() {
var fecha = new Date();
var sumarsesion = 5;
return fecha.getMinutes() + ":" + fecha.setMinutes(fecha.getMinutes() + sumarsesion);
}
And the result I get is the following
40: 1533732320697
The first time is well obtained, that is, if we put the page at 14:40, it returns 40 as the first value correctly, but then it would not have to return 45?
What am I doing wrong?